cleaning up the runloop source properly (was causing crashes in embedded situations, as the runloop source persisted)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2006-10-20 06:04:12 +00:00
parent 91641d0443
commit 7113b61aaf

View File

@@ -850,6 +850,8 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
event_posted_context.perform = macPostedEventCallback;
m_macEventPosted = CFRunLoopSourceCreate(NULL,0,&event_posted_context);
CFRunLoopAddSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
// run loop takes ownership
CFRelease(m_macEventPosted);
#endif
UMAShowArrowCursor() ;
@@ -908,8 +910,10 @@ void wxApp::CleanUp()
#ifdef __WXMAC_OSX__
if (m_macEventPosted)
CFRelease(m_macEventPosted);
m_macEventPosted = NULL;
{
CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
m_macEventPosted = NULL;
}
#endif
// One last chance for pending objects to be cleaned up