diff options
Diffstat (limited to 'plugins/mTextControl/src/ImageDataObjectHlp.cpp')
-rw-r--r-- | plugins/mTextControl/src/ImageDataObjectHlp.cpp | 12 |
1 files changed, 2 insertions, 10 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;
}
|