make sure we don't execute pending deletes either when in runModel, otherwise reentrancy problems occur
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -54,6 +54,7 @@ public:
|
|||||||
AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags);
|
AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags);
|
||||||
#endif // wxUSE_EVENTLOOP_SOURCE
|
#endif // wxUSE_EVENTLOOP_SOURCE
|
||||||
|
|
||||||
|
bool ShouldProcessIdleEvents() const { return m_processIdleEvents ; }
|
||||||
protected:
|
protected:
|
||||||
void CommonModeObserverCallBack(CFRunLoopObserverRef observer, int activity);
|
void CommonModeObserverCallBack(CFRunLoopObserverRef observer, int activity);
|
||||||
void DefaultModeObserverCallBack(CFRunLoopObserverRef observer, int activity);
|
void DefaultModeObserverCallBack(CFRunLoopObserverRef observer, int activity);
|
||||||
@@ -106,6 +107,8 @@ class WXDLLIMPEXP_BASE wxCFEventLoopPauseIdleEvents : public wxObject
|
|||||||
public:
|
public:
|
||||||
wxCFEventLoopPauseIdleEvents();
|
wxCFEventLoopPauseIdleEvents();
|
||||||
virtual ~wxCFEventLoopPauseIdleEvents();
|
virtual ~wxCFEventLoopPauseIdleEvents();
|
||||||
|
private:
|
||||||
|
bool m_formerState;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _WX_OSX_EVTLOOP_H_
|
#endif // _WX_OSX_EVTLOOP_H_
|
||||||
|
@@ -163,13 +163,13 @@ void wxCFEventLoop::CommonModeObserverCallBack(CFRunLoopObserverRef WXUNUSED(obs
|
|||||||
// and this input is only removed from it when pending event handlers are
|
// and this input is only removed from it when pending event handlers are
|
||||||
// executed)
|
// executed)
|
||||||
|
|
||||||
if ( wxTheApp )
|
if ( wxTheApp && ShouldProcessIdleEvents() )
|
||||||
wxTheApp->ProcessPendingEvents();
|
wxTheApp->ProcessPendingEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( activity & kCFRunLoopBeforeWaiting )
|
if ( activity & kCFRunLoopBeforeWaiting )
|
||||||
{
|
{
|
||||||
if ( m_processIdleEvents && ProcessIdle() )
|
if ( ShouldProcessIdleEvents() && ProcessIdle() )
|
||||||
{
|
{
|
||||||
WakeUp();
|
WakeUp();
|
||||||
}
|
}
|
||||||
@@ -445,14 +445,19 @@ wxCFEventLoopPauseIdleEvents::wxCFEventLoopPauseIdleEvents()
|
|||||||
{
|
{
|
||||||
wxCFEventLoop* cfl = dynamic_cast<wxCFEventLoop*>(wxEventLoopBase::GetActive());
|
wxCFEventLoop* cfl = dynamic_cast<wxCFEventLoop*>(wxEventLoopBase::GetActive());
|
||||||
if ( cfl )
|
if ( cfl )
|
||||||
|
{
|
||||||
|
m_formerState = cfl->ShouldProcessIdleEvents();
|
||||||
cfl->SetProcessIdleEvents(false);
|
cfl->SetProcessIdleEvents(false);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
m_formerState = true;
|
||||||
|
}
|
||||||
|
|
||||||
wxCFEventLoopPauseIdleEvents::~wxCFEventLoopPauseIdleEvents()
|
wxCFEventLoopPauseIdleEvents::~wxCFEventLoopPauseIdleEvents()
|
||||||
{
|
{
|
||||||
wxCFEventLoop* cfl = dynamic_cast<wxCFEventLoop*>(wxEventLoopBase::GetActive());
|
wxCFEventLoop* cfl = dynamic_cast<wxCFEventLoop*>(wxEventLoopBase::GetActive());
|
||||||
if ( cfl )
|
if ( cfl )
|
||||||
cfl->SetProcessIdleEvents(true);
|
cfl->SetProcessIdleEvents(m_formerState);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO Move to thread_osx.cpp
|
// TODO Move to thread_osx.cpp
|
||||||
|
Reference in New Issue
Block a user