summaryrefslogtreecommitdiff
path: root/plugins/SpellChecker/src/dictionary.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-17 11:15:15 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-17 11:15:15 +0000
commit152da8847e828b132c5753ae5f58e8272556d4ef (patch)
tree7c96822b3ea2dee6257071d557259177c11da6f0 /plugins/SpellChecker/src/dictionary.cpp
parent79c0e81fbfd1f933a1e251db23dc1fd537ddd239 (diff)
some another leaks fixed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4070 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SpellChecker/src/dictionary.cpp')
-rw-r--r--plugins/SpellChecker/src/dictionary.cpp17
1 files changed, 6 insertions, 11 deletions
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;
}