From 152da8847e828b132c5753ae5f58e8272556d4ef Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 17 Mar 2013 11:15:15 +0000 Subject: some another leaks fixed git-svn-id: http://svn.miranda-ng.org/main/trunk@4070 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SpellChecker/src/dictionary.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'plugins/SpellChecker/src') diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index 883f5852f9..5ef89dae92 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -19,8 +19,6 @@ Boston, MA 02111-1307, USA. #include "commons.h" -DWORD WINAPI LoadThread(LPVOID hd); - // Additional languages that i could not find in Windows TCHAR *aditionalLanguages[] = { LPGENT("tl_PH"), LPGENT("Tagalog (Philippines)"), @@ -337,6 +335,8 @@ struct { #define LANGUAGE_LOADING -1 #define LANGUAGE_LOADED 0 +void LoadThread(LPVOID hd); + class HunspellDictionary : public Dictionary { protected: TCHAR fileWithoutExtension[1024]; @@ -412,7 +412,7 @@ protected: WideCharToMultiByte(codePage, 0, word, -1, hunspellWord, (int)hunspellWordLen, NULL, NULL); } - TCHAR * fromHunspell(const char *hunspellWord) + TCHAR* fromHunspell(const char *hunspellWord) { int len = MultiByteToWideChar(codePage, 0, hunspellWord, -1, NULL, 0); WCHAR *ret = (WCHAR *) malloc((len + 1) * sizeof(WCHAR)); @@ -420,7 +420,7 @@ protected: return ret; } - TCHAR * fromHunspellAndFree(char *hunspellWord) + TCHAR* fromHunspellAndFree(char *hunspellWord) { if (hunspellWord == NULL) return NULL; @@ -695,10 +695,7 @@ public: if (loaded == LANGUAGE_NOT_LOADED) { loaded = LANGUAGE_LOADING; - - DWORD thread_id; - CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) LoadThread, - (LPVOID) this, 0, &thread_id); + mir_forkthread(LoadThread, this); } } @@ -722,12 +719,10 @@ public: } }; - -DWORD WINAPI LoadThread(LPVOID hd) +void LoadThread(LPVOID hd) { HunspellDictionary *dict = (HunspellDictionary *) hd; dict->loadThread(); - return 0; } -- cgit v1.2.3