From e1750ee504d76e065ee16f3d6347eb8a396372bb Mon Sep 17 00:00:00 2001 From: twanvl Date: Mon, 29 Dec 2008 18:49:05 +0000 Subject: [PATCH] renamed SpellChecker::destroy to destroyAll, because the former conflicted with IntrusivePtrBase::destroy. The result was that destroy was called recursively and objects were freed multiple times. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1264 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/main.cpp | 2 ++ src/util/spell_checker.cpp | 2 +- src/util/spell_checker.hpp | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index fb68e1a2..240e7480 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -258,6 +259,7 @@ int MSE::OnExit() { thumbnail_thread.abortAll(); settings.write(); package_manager.destroy(); + SpellChecker::destroyAll(); return 0; } diff --git a/src/util/spell_checker.cpp b/src/util/spell_checker.cpp index f46b9f3d..e3b533d1 100644 --- a/src/util/spell_checker.cpp +++ b/src/util/spell_checker.cpp @@ -39,7 +39,7 @@ SpellChecker::SpellChecker(const char* aff_path, const char* dic_path) , encoding(String(get_dic_encoding(), IF_UNICODE(wxConvLibc, wxSTRING_MAXLEN))) {} -void SpellChecker::destroy() { +void SpellChecker::destroyAll() { spellers.clear(); } diff --git a/src/util/spell_checker.hpp b/src/util/spell_checker.hpp index 57d9453f..e2831721 100644 --- a/src/util/spell_checker.hpp +++ b/src/util/spell_checker.hpp @@ -23,7 +23,7 @@ class SpellChecker : public Hunspell, public IntrusivePtrBase { /** Note: This is not threadsafe yet */ static SpellChecker& get(const String& language); /// Destroy all cached SpellChecker objects - static void destroy(); + static void destroyAll(); /// Check the spelling of a single word bool spell(const String& word);