From eeebc45e0085f3844cf515adf3e8f3da97db623c Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 30 Apr 2015 09:52:33 +0000 Subject: minus critical section git-svn-id: http://svn.miranda-ng.org/main/trunk@13287 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/mTextControl/src/ImageDataObjectHlp.cpp | 12 ++---------- plugins/mTextControl/src/ImageDataObjectHlp.h | 1 - plugins/mTextControl/src/main.cpp | 1 - 3 files changed, 2 insertions(+), 12 deletions(-) (limited to 'plugins/mTextControl/src') diff --git a/plugins/mTextControl/src/ImageDataObjectHlp.cpp b/plugins/mTextControl/src/ImageDataObjectHlp.cpp index 0ff5b9c479..423e92c0a2 100644 --- a/plugins/mTextControl/src/ImageDataObjectHlp.cpp +++ b/plugins/mTextControl/src/ImageDataObjectHlp.cpp @@ -30,12 +30,7 @@ struct EMFCACHE EMFCACHE *next; } *emfCache = 0; int emfCacheSize = 0; -CRITICAL_SECTION csEmfCache; - -void LoadEmfCache() -{ - InitializeCriticalSection(&csEmfCache); -} +mir_cs csEmfCache; void UnloadEmfCache() { @@ -45,13 +40,12 @@ void UnloadEmfCache() delete emfCache; emfCache = tmp; } - DeleteCriticalSection(&csEmfCache); } HENHMETAFILE CacheIconToEmf(HICON hIcon) { HENHMETAFILE result = 0; - EnterCriticalSection(&csEmfCache); + mir_cslock lck(csEmfCache); for (EMFCACHE *p = emfCache; p; p = p->next) if (p->hIcon == hIcon) { @@ -103,8 +97,6 @@ HENHMETAFILE CacheIconToEmf(HICON hIcon) emfCacheSize = 20; } - LeaveCriticalSection(&csEmfCache); - return result; } diff --git a/plugins/mTextControl/src/ImageDataObjectHlp.h b/plugins/mTextControl/src/ImageDataObjectHlp.h index 730c6fa550..4884d2a1f2 100644 --- a/plugins/mTextControl/src/ImageDataObjectHlp.h +++ b/plugins/mTextControl/src/ImageDataObjectHlp.h @@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _IMAGEDATAOBJECTHLP_ #define _IMAGEDATAOBJECTHLP_ -void LoadEmfCache(); void UnloadEmfCache(); HENHMETAFILE CacheIconToEmf(HICON hIcon); diff --git a/plugins/mTextControl/src/main.cpp b/plugins/mTextControl/src/main.cpp index 7a0f350288..27849f53d0 100644 --- a/plugins/mTextControl/src/main.cpp +++ b/plugins/mTextControl/src/main.cpp @@ -64,7 +64,6 @@ extern "C" __declspec(dllexport) int Load(void) if (hMsfteditDll) MyCreateTextServices = (pfnMyCreateTextServices)GetProcAddress(hMsfteditDll, "CreateTextServices"); - LoadEmfCache(); LoadRichEdit(); LoadTextUsers(); LoadServices(); -- cgit v1.2.3