Commit 4da7d716 authored by twanvl's avatar twanvl

renamed SpellChecker::destroy to destroyAll, because the former conflicted...

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.
parent dd46e406
......@@ -8,6 +8,7 @@
#include <util/prec.hpp>
#include <util/io/package_manager.hpp>
#include <util/spell_checker.hpp>
#include <data/game.hpp>
#include <data/set.hpp>
#include <data/settings.hpp>
......@@ -258,6 +259,7 @@ int MSE::OnExit() {
thumbnail_thread.abortAll();
settings.write();
package_manager.destroy();
SpellChecker::destroyAll();
return 0;
}
......
......@@ -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();
}
......
......@@ -23,7 +23,7 @@ class SpellChecker : public Hunspell, public IntrusivePtrBase<SpellChecker> {
/** 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment