From 82ae452fff08430d514f762f49e78fec90f88625 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 17 Mar 2013 15:06:11 +0000 Subject: - rest of memory leaks - code cleaning; git-svn-id: http://svn.miranda-ng.org/main/trunk@4078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SpellChecker/src/dictionary.cpp | 7 +++++-- plugins/SpellChecker/src/dictionary.h | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'plugins/SpellChecker/src') diff --git a/plugins/SpellChecker/src/dictionary.cpp b/plugins/SpellChecker/src/dictionary.cpp index 5ef89dae92..aeb03b4b86 100644 --- a/plugins/SpellChecker/src/dictionary.cpp +++ b/plugins/SpellChecker/src/dictionary.cpp @@ -984,12 +984,15 @@ void GetAvaibleDictionaries(LIST &dicts, TCHAR *path, TCHAR *user_pa void FreeDictionaries(LIST &dicts) { for (int i = 0; i < dicts.getCount(); i++) - { delete dicts[i]; - } + dicts.destroy(); } +Dictionary::~Dictionary() +{ + delete autoReplace; +} // Free the list returned by GetAvaibleDictionaries void FreeSuggestions(Suggestions &suggestions) diff --git a/plugins/SpellChecker/src/dictionary.h b/plugins/SpellChecker/src/dictionary.h index 3add2d739c..09902435f6 100644 --- a/plugins/SpellChecker/src/dictionary.h +++ b/plugins/SpellChecker/src/dictionary.h @@ -40,35 +40,35 @@ public: AutoReplaceMap *autoReplace; HANDLE hIcolib; - virtual ~Dictionary() {} + virtual ~Dictionary(); // Return TRUE if the word is correct - virtual BOOL spell(const TCHAR *) =0; + virtual BOOL spell(const TCHAR *) = 0; // Return a list of suggestions to a word - virtual Suggestions suggest(const TCHAR * word) =0; + virtual Suggestions suggest(const TCHAR * word) = 0; // Return a list of auto suggestions to a word - virtual Suggestions autoSuggest(const TCHAR * word) =0; + virtual Suggestions autoSuggest(const TCHAR * word) = 0; // Return a auto suggestions to a word // You have to free the item - virtual TCHAR * autoSuggestOne(const TCHAR * word) =0; + virtual TCHAR * autoSuggestOne(const TCHAR * word) = 0; // Return TRUE if the char is a word char - virtual BOOL isWordChar(TCHAR c) =0; + virtual BOOL isWordChar(TCHAR c) = 0; // Add a word to the user custom dict - virtual void addWord(const TCHAR * word) =0; + virtual void addWord(const TCHAR * word) = 0; // Add a word to the list of ignored words - virtual void ignoreWord(const TCHAR * word) =0; + virtual void ignoreWord(const TCHAR * word) = 0; // Assert that all needed data is loaded - virtual void load() =0; + virtual void load() = 0; // Return TRUE if the dict is fully loaded - virtual BOOL isLoaded() =0; + virtual BOOL isLoaded() = 0; }; -- cgit v1.2.3