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/icq_infoupdate.cpp | 44 ++++++++++++++-------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'protocols/IcqOscarJ/icq_infoupdate.cpp') diff --git a/protocols/IcqOscarJ/icq_infoupdate.cpp b/protocols/IcqOscarJ/icq_infoupdate.cpp index a5bf1656a7..5d0abbf47c 100644 --- a/protocols/IcqOscarJ/icq_infoupdate.cpp +++ b/protocols/IcqOscarJ/icq_infoupdate.cpp @@ -35,21 +35,18 @@ void CIcqProto::icq_InitInfoUpdate(void) { // Create wait objects hInfoQueueEvent = CreateEvent(NULL, FALSE, FALSE, NULL); - - if (hInfoQueueEvent) - { + if (hInfoQueueEvent) { // Init mutexes infoUpdateMutex = new icq_critical_section(); // Init list - for (int i = 0; iEnter(); if (!m_rates) // we lost connection when we slept, go away @@ -391,19 +383,19 @@ void __cdecl CIcqProto::InfoUpdateThread( void* ) break; } } + NetLog_Server("%s thread ended.", "Info-Update"); + +LBL_Exit: + SAFE_DELETE(&infoUpdateMutex); + CloseHandle(hInfoQueueEvent); } // Clean up before exit void CIcqProto::icq_InfoUpdateCleanup(void) { + NetLog_Server("%s must die.", "Info-Update"); bInfoUpdateRunning = FALSE; - SetEvent(hInfoQueueEvent); // break queue loop - if (hInfoThread) - ICQWaitForSingleObject(hInfoThread, INFINITE, TRUE); - - // Uninit mutex - SAFE_DELETE(&infoUpdateMutex); - CloseHandle(hInfoQueueEvent); - CloseHandle(hInfoThread); + if (hInfoQueueEvent) + SetEvent(hInfoQueueEvent); // break queue loop } -- cgit v1.2.3