summaryrefslogtreecommitdiff
path: root/src/modules/clist/genmenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/clist/genmenu.cpp')
-rw-r--r--src/modules/clist/genmenu.cpp13
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;
}