diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-30 09:52:33 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-04-30 09:52:33 +0000 |
commit | eeebc45e0085f3844cf515adf3e8f3da97db623c (patch) | |
tree | 66cd219832887ac176b20d0225db88d9a74f3abf /plugins/mTextControl/src | |
parent | 329f87401432b166f47ae076a58d12029863649c (diff) |
minus critical section
git-svn-id: http://svn.miranda-ng.org/main/trunk@13287 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/mTextControl/src')
-rw-r--r-- | plugins/mTextControl/src/ImageDataObjectHlp.cpp | 12 | ||||
-rw-r--r-- | plugins/mTextControl/src/ImageDataObjectHlp.h | 1 | ||||
-rw-r--r-- | plugins/mTextControl/src/main.cpp | 1 |
3 files changed, 2 insertions, 12 deletions
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();
|