diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-30 07:30:45 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-30 07:30:45 +0000 |
commit | 0f9a3e7131cab98898c525882974b5b8f321220d (patch) | |
tree | d2a3551afb85514b1c75288393e014f8dbd2f2d1 /plugins/NoHistory/src | |
parent | 06b0e8f8e4fa296832c7e053ac74ea4d790bd26e (diff) |
minus critical section
git-svn-id: http://svn.miranda-ng.org/main/trunk@13280 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NoHistory/src')
-rw-r--r-- | plugins/NoHistory/src/dllmain.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
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;
}
|