summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/spellchecker
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-08 07:55:07 +0000
committerhbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-08 07:55:07 +0000
commitfd4cfdd4a6164b0403ea9ef29c3ba891924d8311 (patch)
tree056b564dca040f16f25ef35d7e6277250f5ae9d3 /chrome/renderer/spellchecker
parent38a89d10031f121ebb64ba72e830b48f10a37b0f (diff)
downloadchromium_src-fd4cfdd4a6164b0403ea9ef29c3ba891924d8311.zip
chromium_src-fd4cfdd4a6164b0403ea9ef29c3ba891924d8311.tar.gz
chromium_src-fd4cfdd4a6164b0403ea9ef29c3ba891924d8311.tar.bz2
Fix a leak in SpellCheckProviderTest.
This change just deletes an IPC message when it is handled by my mock function. BUG=112857 TEST=unit_tests SpellCheckProviderTest.UsingHunspell on valgrind or heapchecker. Review URL: https://chromiumcodereview.appspot.com/9349011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120953 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/spellchecker')
-rw-r--r--chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc b/chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc
index 0a8f835..fac46f7 100644
--- a/chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc
+++ b/chrome/renderer/spellchecker/spellcheck_provider_hunspell_unittest.cc
@@ -28,11 +28,17 @@ class TestingSpellCheckProvider : public SpellCheckProvider {
virtual bool Send(IPC::Message* message) OVERRIDE {
// Call our mock message handlers.
+ bool handled = true;
IPC_BEGIN_MESSAGE_MAP(TestingSpellCheckProvider, *message)
IPC_MESSAGE_HANDLER(SpellCheckHostMsg_CallSpellingService,
OnCallSpellingService)
- IPC_MESSAGE_UNHANDLED(messages_.push_back(message))
+ IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
+ if (handled) {
+ delete message;
+ return true;
+ }
+ messages_.push_back(message);
return true;
}