From 0f9a3e7131cab98898c525882974b5b8f321220d Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 30 Apr 2015 07:30:45 +0000 Subject: minus critical section git-svn-id: http://svn.miranda-ng.org/main/trunk@13280 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NoHistory/src/dllmain.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'plugins') diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 53c4df12b4..a8d0f00abe 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -11,7 +11,7 @@ static int SrmmMenu_ProcessIconClick(WPARAM wParam, LPARAM lParam); HGENMENU hMenuToggle, hMenuClear; HANDLE hServiceToggle, hServiceClear; -CRITICAL_SECTION list_cs; +mir_cs list_cs; #define MS_NOHISTORY_TOGGLE MODULE "/ToggleOnOff" #define MS_NOHISTORY_CLEAR MODULE "/Clear" @@ -59,7 +59,7 @@ void RemoveReadEvents(MCONTACT hContact = 0) DBEVENTINFO info = { sizeof(info) }; bool remove; - EnterCriticalSection(&list_cs); + mir_cslock lck(list_cs); EventListNode *node = event_list, *prev = 0; while(node) { remove = false; @@ -93,8 +93,6 @@ void RemoveReadEvents(MCONTACT hContact = 0) node = node->next; } } - - LeaveCriticalSection(&list_cs); } void RemoveAllEvents(MCONTACT hContact) @@ -125,10 +123,9 @@ int OnDatabaseEventAdd(WPARAM hContact, LPARAM hDBEvent) node->hContact = hContact; node->hDBEvent = hDBEvent; - EnterCriticalSection(&list_cs); + mir_cslock lck(list_cs); node->next = event_list; event_list = node; - LeaveCriticalSection(&list_cs); } } @@ -273,8 +270,6 @@ extern "C" __declspec (dllexport) int Load() { mir_getLP(&pluginInfo); - InitializeCriticalSection(&list_cs); - // Ensure that the common control DLL is loaded (for listview) INITCOMMONCONTROLSEX icex = { sizeof(icex), ICC_LISTVIEW_CLASSES }; InitCommonControlsEx(&icex); @@ -297,6 +292,5 @@ extern "C" __declspec (dllexport) int Unload(void) DestroyServiceFunction(hServiceClear); RemoveReadEvents(); - DeleteCriticalSection(&list_cs); return 0; } -- cgit v1.2.3