// Author: David Webster
// Modified by:
// Created: 10/13/99
-// RCS-ID: $Id$
// Copyright: (c) David Webster
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Some people may wish to use this, but
// probably it shouldn't be here by default.
-#ifdef __WXDEBUG__
// wxRedirectIOToConsole();
-#endif
wxWinHandleHash = new wxWinHashTable(wxKEY_INTEGER, 100);
//
void wxApp::CleanUp()
{
- delete[] wxBuffer;
- wxBuffer = NULL;
+ wxDELETEA(wxBuffer);
//
// PM-SPECIFIC CLEANUP
// TODO: ::DeleteObject( wxDisableButtonBrush );
}
- delete wxWinHandleHash;
- wxWinHandleHash = NULL;
+ wxDELETE(wxWinHandleHash);
// Delete Message queue
if (wxTheApp->m_hMq)
}
} // end of wxApp::OnQueryEndSession
-//
-// Yield to incoming messages
-//
-bool wxApp::Yield(bool onlyIfNeeded)
-{
- if ( m_isInsideYield )
- {
- if ( !onlyIfNeeded )
- {
- wxFAIL_MSG( _T("wxYield() called recursively") );
- }
-
- return false;
- }
-
- HAB vHab = 0;
- QMSG vMsg;
-
- //
- // Disable log flushing from here because a call to wxYield() shouldn't
- // normally result in message boxes popping up &c
- //
- wxLog::Suspend();
-
- m_isInsideYield = true;
-
- //
- // We want to go back to the main message loop
- // if we see a WM_QUIT. (?)
- //
- wxEventLoopGuarantor dummyLoopIfNeeded;
- while (::WinPeekMsg(vHab, &vMsg, (HWND)NULL, 0, 0, PM_NOREMOVE) && vMsg.msg != WM_QUIT)
- {
-#if wxUSE_THREADS
- wxMutexGuiLeaveOrEnter();
-#endif // wxUSE_THREADS
- if (!wxTheApp->Dispatch())
- break;
- }
-
- //
- // If they are pending events, we must process them.
- //
- if (wxTheApp)
- wxTheApp->ProcessPendingEvents();
-
- HandleSockets();
-
- //
- // Let the logs be flashed again
- //
- wxLog::Resume();
- m_isInsideYield = false;
-
- return true;
-} // end of wxYield
-
int wxApp::AddSocketHandler(int handle, int mask,
void (*callback)(void*), void * gsock)
{