From 37cbdcc9964ad7b3af8a5420fdbaebe67d11a60c Mon Sep 17 00:00:00 2001 From: "sidchat@google.com" Date: Thu, 18 Sep 2008 20:30:06 +0000 Subject: Fix a memory leak in Add to dictionary code. Review URL: http://codereview.chromium.org/3148 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2379 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/third_party/hunspell/src/hunspell/hashmgr.cxx | 5 +++++ chrome/third_party/hunspell/src/hunspell/hashmgr.hxx | 1 + 2 files changed, 6 insertions(+) (limited to 'chrome') diff --git a/chrome/third_party/hunspell/src/hunspell/hashmgr.cxx b/chrome/third_party/hunspell/src/hunspell/hashmgr.cxx index f1c1355..51c054f 100644 --- a/chrome/third_party/hunspell/src/hunspell/hashmgr.cxx +++ b/chrome/third_party/hunspell/src/hunspell/hashmgr.cxx @@ -121,6 +121,11 @@ HashMgr::~HashMgr() #ifdef HUNSPELL_CHROME_CLIENT EmptyHentryCache(); + STLDeleteValues(&custom_word_to_hentry_map_); + for (std::vector::iterator it = pointer_to_strings_.begin(); + it != pointer_to_strings_.end(); ++it) { + delete *it; + } #endif } diff --git a/chrome/third_party/hunspell/src/hunspell/hashmgr.hxx b/chrome/third_party/hunspell/src/hunspell/hashmgr.hxx index f247f80..4f60646 100644 --- a/chrome/third_party/hunspell/src/hunspell/hashmgr.hxx +++ b/chrome/third_party/hunspell/src/hunspell/hashmgr.hxx @@ -5,6 +5,7 @@ #include "htypes.hxx" #ifdef HUNSPELL_CHROME_CLIENT +#include "chrome/common/stl_util-inl.h" #include "chrome/third_party/hunspell/google/bdict_reader.h" #include "base/string_piece.h" #include -- cgit v1.1