adding proper removal of observer for stacked event loops, using cfrunloop for console on osx as well
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63698 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -186,16 +186,19 @@ wxCFEventLoop::wxCFEventLoop()
|
||||
{
|
||||
m_shouldExit = false;
|
||||
|
||||
m_runLoop = CFGetCurrentRunLoop();
|
||||
|
||||
CFRunLoopObserverContext ctxt;
|
||||
bzero( &ctxt, sizeof(ctxt) );
|
||||
ctxt.info = this;
|
||||
m_runLoopObserver = CFRunLoopObserverCreate( kCFAllocatorDefault, kCFRunLoopBeforeTimers | kCFRunLoopBeforeWaiting , true /* repeats */, 0,
|
||||
wxObserverCallBack, &ctxt );
|
||||
CFRunLoopAddObserver(CFGetCurrentRunLoop(), m_runLoopObserver, kCFRunLoopDefaultMode);
|
||||
CFRunLoopAddObserver(m_runLoop, m_runLoopObserver, kCFRunLoopDefaultMode);
|
||||
}
|
||||
|
||||
wxCFEventLoop::~wxCFEventLoop()
|
||||
{
|
||||
CFRunLoopRemoveObserver(m_runLoop, m_runLoopObserver, kCFRunLoopDefaultMode);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user