Discussion:
[Clanlib-devel] CL_NetSession destructor problem (0.8 SVN Rev 799)
Neo phyte
2006-02-19 23:56:18 UTC
Permalink
When the destructor for CL_NetSession is called, it hangs in the
CL_Thread::wait function:

void CL_NetSession_Generic::shutdown()
{
[...]
// Stop udp thread.
udp_shutdown_trigger.set_flag();
send_udp_thread.wait();
}

thread_win32.cpp:
void CL_Thread::wait()
{
if (impl->thread_handle == NULL) return;

WaitForSingleObject(impl->thread_handle, INFINITE); // <- hangs here
CloseHandle(impl->thread_handle);
impl->thread_handle = NULL;
}

-------
Code to replicate:

int App::main(int, char **) {

CL_ConsoleWindow console("Client Console");
console.redirect_stdio();
try {
CL_SetupCore setup_core;
CL_SetupNetwork setup_network;
CL_NetSession netsession("MyGame");
} catch (CL_Error err) {
std::cout << "Exception caught: " << err.message.c_str() << std::endl;
console.display_close_message();
}

return 0;
}
--
10 GB Mailbox, 100 FreeSMS/Monat http://www.gmx.net/de/go/topmail
+++ GMX - die erste Adresse f�r Mail, Message, More +++
Loading...