From 5df94ff719eccd04c7450df35fb5e3f2b36e2ee7 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 13 Jul 2014 10:50:59 +0000 Subject: 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 --- src/modules/icolib/IcoLib.h | 2 +- src/modules/icolib/skin2icons.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/modules/icolib') diff --git a/src/modules/icolib/IcoLib.h b/src/modules/icolib/IcoLib.h index d743e0e4fd..337de4be7d 100644 --- a/src/modules/icolib/IcoLib.h +++ b/src/modules/icolib/IcoLib.h @@ -98,7 +98,7 @@ HICON IconItem_GetIcon(IcolibItem* item, bool big); int SkinOptionsInit(WPARAM, LPARAM); -extern CRITICAL_SECTION csIconList; +extern mir_cs csIconList; extern LIST iconList; extern LIST sectionList; diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp index 139a369eb2..35e77a8e37 100644 --- a/src/modules/icolib/skin2icons.cpp +++ b/src/modules/icolib/skin2icons.cpp @@ -39,7 +39,7 @@ int iconEventActive = 0; BOOL bNeedRebuild = FALSE; -CRITICAL_SECTION csIconList; +mir_cs csIconList; static int sttCompareSections(const SectionItem* p1, const SectionItem* p2) { @@ -837,7 +837,6 @@ int LoadIcoLibModule(void) hIconBlank = LoadIconEx(NULL, MAKEINTRESOURCE(IDI_BLANK), 0); - InitializeCriticalSection(&csIconList); hIcoLib_AddNewIcon = CreateServiceFunction("Skin2/Icons/AddIcon", sttIcoLib_AddNewIcon); hIcoLib_RemoveIcon = CreateServiceFunction(MS_SKIN2_REMOVEICON, IcoLib_RemoveIcon); hIcoLib_GetIcon = CreateServiceFunction(MS_SKIN2_GETICON, sttIcoLib_GetIcon); @@ -873,7 +872,6 @@ void UnloadIcoLibModule(void) DestroyServiceFunction(hIcoLib_IsManaged); DestroyServiceFunction(hIcoLib_AddRef); DestroyServiceFunction(hIcoLib_ReleaseIcon); - DeleteCriticalSection(&csIconList); for (i = iconList.getCount()-1; i >= 0; i--) { IcolibItem* p = iconList[i]; -- cgit v1.2.3