diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-14 08:56:46 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-14 08:56:46 +0000 |
commit | 7a917d3884e32266bd8645287c558fe095e986a3 (patch) | |
tree | 2838aa7030a2dee67dd19da05aa62c86bd99aba4 /protocols/IcqOscarJ/chan_05ping.cpp | |
parent | c597d66aa12a6cc27c6b0ffb87d8e63a63a86846 (diff) |
fix for killing ICQ threads on exit
git-svn-id: http://svn.miranda-ng.org/main/trunk@962 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/chan_05ping.cpp')
-rw-r--r-- | protocols/IcqOscarJ/chan_05ping.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
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;
- }
}
|