diff options
Diffstat (limited to 'plugins/mTextControl')
-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();
|