extern wxList *wxWinHandleList;
extern wxList WXDLLEXPORT wxPendingDelete;
extern void wxSetKeyboardHook(bool doIt);
-extern wxCursor *g_globalCursor;
MSG s_currentMsg;
wxApp *wxTheApp = NULL;
Ctl3dAutoSubclass(wxhInstance);
#endif
- g_globalCursor = new wxCursor;
-
// VZ: these icons are not in wx.rc anyhow (but should they?)!
#if 0
wxSTD_FRAME_ICON = LoadIcon(wxhInstance, wxT("wxSTD_FRAME"));
// wxDefaultResourceTable->ClearTable();
#endif
- // Indicate that the cursor can be freed, so that cursor won't be deleted
- // by deleting the bitmap list before g_globalCursor goes out of scope
- // (double deletion of the cursor).
- wxSetCursor(wxNullCursor);
- delete g_globalCursor;
- g_globalCursor = NULL;
-
wxDeleteStockObjects();
// Destroy all GDI lists, etc.
// wxDebugContext, too.
if (wxDebugContext::CountObjectsLeft(TRUE) > 0)
{
- wxLogDebug(wxT("There were memory leaks."));
+ wxLogMessage(wxT("There were memory leaks."));
wxDebugContext::Dump();
wxDebugContext::PrintStatistics();
}
s_inOnIdle = TRUE;
+ // If there are pending events, we must process them: pending events
+ // are either events to the threads other than main or events posted
+ // with wxPostEvent() functions
+ // GRG: I have moved this here so that all pending events are processed
+ // before starting to delete any objects. This behaves better (in
+ // particular, wrt wxPostEvent) and is coherent with wxGTK's current
+ // behaviour. Changed Feb/2000 before 2.1.14
+ ProcessPendingEvents();
+
// 'Garbage' collection of windows deleted with Close().
DeletePendingObjects();
#if wxUSE_LOG
// flush the logged messages if any
- wxLog *pLog = wxLog::GetActiveTarget();
- if ( pLog != NULL && pLog->HasPendingMessages() )
- pLog->Flush();
+ wxLog::FlushActive();
#endif // wxUSE_LOG
// Send OnIdle events to all windows
event.RequestMore(TRUE);
}
- // If they are pending events, we must process them: pending events are
- // either events to the threads other than main or events posted with
- // wxPostEvent() functions
- ProcessPendingEvents();
-
s_inOnIdle = FALSE;
}
// Yield to incoming messages
bool wxYield()
{
+ // disable log flushing from here because a call to wxYield() shouldn't
+ // normally result in message boxes popping up &c
+ wxLog::Suspend();
+
// we don't want to process WM_QUIT from here - it should be processed in
// the main event loop in order to stop it
-
MSG msg;
while ( PeekMessage(&msg, (HWND)0, 0, 0, PM_NOREMOVE) &&
msg.message != WM_QUIT )
// If they are pending events, we must process them.
wxTheApp->ProcessPendingEvents();
+ // let the logs be flashed again
+ wxLog::Resume();
+
return TRUE;
}