wxDELETE(m_traits);
#endif
#endif
+
+ wxEvtHandler::AddFilter(this);
}
wxAppConsoleBase::~wxAppConsoleBase()
{
+ wxEvtHandler::RemoveFilter(this);
+
// we're being destroyed and using this object from now on may not work or
// even crash so don't leave dangling pointers to it
ms_appInstance = NULL;
bool wxAppConsoleBase::Yield(bool onlyIfNeeded)
{
wxEventLoopBase * const loop = wxEventLoopBase::GetActive();
+ if ( loop )
+ return loop->Yield(onlyIfNeeded);
- return loop && loop->Yield(onlyIfNeeded);
+ wxScopedPtr<wxEventLoopBase> tmpLoop(CreateMainLoop());
+ return tmpLoop->Yield(onlyIfNeeded);
}
void wxAppConsoleBase::WakeUpIdle()
wxLog::FlushActive();
#endif
+ // Garbage collect all objects previously scheduled for destruction.
+ DeletePendingObjects();
+
return event.MoreRequested();
}
int wxAppConsoleBase::FilterEvent(wxEvent& WXUNUSED(event))
{
// process the events normally by default
- return -1;
+ return Event_Skip;
}
void wxAppConsoleBase::DelayPendingEventHandler(wxEvtHandler* toDelay)
wxLEAVE_CRIT_SECT(m_handlersWithPendingEventsLocker);
}
-
- // Garbage collect all objects previously scheduled for destruction.
- DeletePendingObjects();
}
void wxAppConsoleBase::DeletePendingEvents()