From 7a917d3884e32266bd8645287c558fe095e986a3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 14 Jul 2012 08:56:46 +0000 Subject: fix for killing ICQ threads on exit git-svn-id: http://svn.miranda-ng.org/main/trunk@962 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/IcqOscarJ/chan_05ping.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'protocols/IcqOscarJ/chan_05ping.cpp') diff --git a/protocols/IcqOscarJ/chan_05ping.cpp b/protocols/IcqOscarJ/chan_05ping.cpp index 53f094efee..2a2b843509 100644 --- a/protocols/IcqOscarJ/chan_05ping.cpp +++ b/protocols/IcqOscarJ/chan_05ping.cpp @@ -44,7 +44,7 @@ void __cdecl CIcqProto::KeepAliveThread(void *arg) NetLog_Server("Keep alive thread starting."); - info->hKeepAliveEvent = CreateEvent(NULL, TRUE, FALSE, NULL); + info->hKeepAliveEvent = CreateEvent(NULL, FALSE, FALSE, NULL); for (;;) { @@ -65,7 +65,7 @@ void __cdecl CIcqProto::KeepAliveThread(void *arg) break; } - NetLog_Server("Keep alive thread shutting down."); + NetLog_Server("Keep alive thread ended."); CloseHandle(info->hKeepAliveEvent); info->hKeepAliveEvent = NULL; @@ -78,19 +78,12 @@ void CIcqProto::StartKeepAlive(serverthread_info *info) return; if (getSettingByte(NULL, "KeepAlive", DEFAULT_KEEPALIVE_ENABLED)) - info->hKeepAliveThread = ForkThreadEx(&CIcqProto::KeepAliveThread, info); + CloseHandle( ForkThreadEx(&CIcqProto::KeepAliveThread, info)); } void CIcqProto::StopKeepAlive(serverthread_info *info) { // finish keep alive thread if (info->hKeepAliveEvent) - { SetEvent(info->hKeepAliveEvent); - - // wait for the thread to finish - ICQWaitForSingleObject(info->hKeepAliveThread, INFINITE, TRUE); - CloseHandle(info->hKeepAliveThread); - info->hKeepAliveThread = NULL; - } } -- cgit v1.2.3