From fb8492db75b7a3e4faaf5ab297c3046747b231a9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 19 Nov 2014 22:05:57 +0000 Subject: fix for hangup on exit git-svn-id: http://svn.miranda-ng.org/main/trunk@11026 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NewsAggregator/Src/Services.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index c9f4fea07b..1e353f7d33 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -29,14 +29,6 @@ void SetContactStatus(MCONTACT hContact, int nNewStatus) db_set_w(hContact, MODULE, "Status", nNewStatus); } -static void __cdecl WorkingThread(void* param) -{ - int nStatus = (int)param; - - for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) - SetContactStatus(hContact, nStatus); -} - int OnFoldersChanged(WPARAM, LPARAM) { FoldersGetCustomPathT(hNewsAggregatorFolder, tszRoot, MAX_PATH, _T("")); @@ -118,7 +110,10 @@ INT_PTR NewsAggrSetStatus(WPARAM wp, LPARAM) int nOldStatus = g_nStatus; if(nStatus != g_nStatus) { g_nStatus = nStatus; - mir_forkthread(WorkingThread, (void *)g_nStatus); + + for (MCONTACT hContact = db_find_first(MODULE); hContact; hContact = db_find_next(hContact, MODULE)) + SetContactStatus(hContact, nStatus); + ProtoBroadcastAck(MODULE, NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)nOldStatus, g_nStatus); } } -- cgit v1.2.3