diff options
author | George Hazan <george.hazan@gmail.com> | 2014-07-13 10:50:59 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-07-13 10:50:59 +0000 |
commit | 5df94ff719eccd04c7450df35fb5e3f2b36e2ee7 (patch) | |
tree | 440d736b199ff849ca0619adf355ffc73750ca7f /src/modules/clist/genmenu.cpp | |
parent | 70496fb739225b559a251f4518c946110aef718c (diff) |
wrapping the most evident critical sections into a class
git-svn-id: http://svn.miranda-ng.org/main/trunk@9785 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/clist/genmenu.cpp')
-rw-r--r-- | src/modules/clist/genmenu.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index 0014545c27..3cf0a71c6d 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static bool bIsGenMenuInited;
bool bIconsDisabled;
-static CRITICAL_SECTION csMenuHook;
+static mir_cs csMenuHook;
static int NextObjectId = 0x100, NextObjectMenuItemId = CLISTMENUIDMIN;
@@ -1150,7 +1150,6 @@ static INT_PTR SRVMO_SetOptionsMenuItem(WPARAM, LPARAM lParam) int InitGenMenu()
{
- InitializeCriticalSection(&csMenuHook);
CreateServiceFunction(MO_BUILDMENU, MO_BuildMenu);
CreateServiceFunction(MO_PROCESSCOMMAND, (MIRANDASERVICE)MO_ProcessCommand);
@@ -1181,13 +1180,9 @@ int InitGenMenu() int UnitGenMenu()
{
if (bIsGenMenuInited) {
- {
- mir_cslock lck(csMenuHook);
- MO_RemoveAllObjects();
- bIsGenMenuInited = false;
- }
-
- DeleteCriticalSection(&csMenuHook);
+ mir_cslock lck(csMenuHook);
+ MO_RemoveAllObjects();
+ bIsGenMenuInited = false;
}
return 0;
}
|