int i;
struct GsocketCallbackInfo
*CallbackInfo = (struct GsocketCallbackInfo *)m_sockCallbackInfo;
- int r = 0;
timeout.tv_sec = 0;
timeout.tv_usec = 0;
if ( select(m_maxSocketNr, &readfds, &writefds, 0, &timeout) > 0)
{
- for (i = m_lastUsedHandle + 1; i != m_lastUsedHandle; i++)
+ for (i = m_lastUsedHandle + 1; i != m_lastUsedHandle;
+ (i < m_maxSocketNr - 1) ? i++ : (i = 0))
{
- if (i == m_maxSocketNr)
- i = 0;
if (FD_ISSET(i, &readfds))
{
int r;
{
CallbackInfo[r].proc(CallbackInfo[r].gsock);
pendingEvent = TRUE;
- wxYield();
}
}
if (FD_ISSET(i, &writefds))
{
CallbackInfo[r].proc(CallbackInfo[r].gsock);
pendingEvent = TRUE;
- wxYield();
}
}
}
m_lastUsedHandle = i;
}
if (pendingEvent)
- wxYield();
+ ProcessPendingEvents();
}
}
// ---------------------------------------------------------------------------
// wxSetKeyboardHook(TRUE);
- RegisterWindowClasses(vHab);
+ RegisterWindowClasses(vHabmain);
return TRUE;
} // end of wxApp::Initialize
if (wxWinHandleList)
delete wxWinHandleList;
- delete wxPendingEvents;
-#if wxUSE_THREADS
- delete wxPendingEventsLocker;
- // If we don't do the following, we get an apparent memory leak.
- ((wxEvtHandler&) wxDefaultValidator).ClearEventLocker();
-#endif
-
// Delete Message queue
if (wxTheApp->m_hMq)
::WinDestroyMsgQueue(wxTheApp->m_hMq);
wxApp::wxApp()
{
- m_topWindow = NULL;
- wxTheApp = this;
-
argc = 0;
argv = NULL;
m_nPrintMode = wxPRINT_WINDOWS;
while (!Pending() && ProcessIdle())
{
HandleSockets();
- wxUsleep(10000);
+ wxUsleep(10);
}
HandleSockets();
if (Pending())
DoMessage();
else
- wxUsleep(10000);
+ wxUsleep(10);
}
return (int)svCurrentMsg.mp1;
gbInOnIdle = TRUE;
- wxAppBase::OnIdle(event);
+ wxAppBase::OnIdle(rEvent);
#if wxUSE_DC_CACHEING
// automated DC cache management: clear the cached DCs and bitmap
if (wxTheApp)
wxTheApp->ProcessPendingEvents();
+ HandleSockets();
//
// Let the logs be flashed again
//