Ensure that wxApp::Yield is always processing pending event by creating a
temporary event loop if needed. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -223,4 +223,30 @@ private:
|
||||
wxEventLoopBase *m_evtLoopOld;
|
||||
};
|
||||
|
||||
class wxEventLoopGuarantor
|
||||
{
|
||||
public:
|
||||
wxEventLoopGuarantor()
|
||||
{
|
||||
m_evtLoopNew = NULL;
|
||||
if (!wxEventLoop::GetActive())
|
||||
{
|
||||
m_evtLoopNew = new wxEventLoop;
|
||||
wxEventLoop::SetActive(m_evtLoopNew);
|
||||
}
|
||||
}
|
||||
|
||||
~wxEventLoopGuarantor()
|
||||
{
|
||||
if (m_evtLoopNew)
|
||||
{
|
||||
wxEventLoop::SetActive(NULL);
|
||||
delete m_evtLoopNew;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
wxEventLoop *m_evtLoopNew;
|
||||
};
|
||||
|
||||
#endif // _WX_EVTLOOP_H_
|
||||
|
Reference in New Issue
Block a user