Socket/Thread issue in 5.23

Hi Rooters,
I am successfully using TMonitor in my windows application to watch multiple clients. Unfortunately, more often than not, when I exit the applications threads remain running. In all cases I appear to have successfully deleted the monitor, server, and socket objects. Also the Enter key message is sometimes lost. What else must I do to shut down cleanly?
Cheers,
Steve Alam

Hi,

See the example $ROOTSYS/test/threads.cxx
If you need more informations, please be more specific about what is the issue, or post a working piece of code showing the problem.

Cheers, Bertrand.

Bertrand,
Windows apparently has not been shutting down the run timer properly when TMonitor is used. In the following code, the IsRunning conditional allows a clean exit:

VOID CALLBACK MyTimerProc(HWND hwnd, UINT message, UINT idTimer, DWORD dwTime) {
static bool inloop = false;
if(!inloop) {
inloop = true;
if (gApplication->IsRunning()) { //don’t undo ->terminate()
gApplication->StartIdleing();
gSystem->InnerLoop();
gApplication->StopIdleing();
}
inloop = false;
}
}

Cheers,
Steve