diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 19:18:02 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-06 19:18:02 +0000 |
commit | 87cfff07b279ac46dfea597e3ce7cfb37ab962b4 (patch) | |
tree | f431ca9c6f999ffa83586954b6f9ef3d909450ae /chrome/renderer | |
parent | 48723353147a73896b553a690a486fff779329a8 (diff) | |
download | chromium_src-87cfff07b279ac46dfea597e3ce7cfb37ab962b4.zip chromium_src-87cfff07b279ac46dfea597e3ce7cfb37ab962b4.tar.gz chromium_src-87cfff07b279ac46dfea597e3ce7cfb37ab962b4.tar.bz2 |
Fix a leak in the RenderView tests. We were responsible for deleting the reply deserializer for sync messages, which wasn't happening for all cases.
BUG=6037
Review URL: http://codereview.chromium.org/17206
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7597 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/mock_render_thread.cc | 11 | ||||
-rw-r--r-- | chrome/renderer/mock_render_thread.h | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/chrome/renderer/mock_render_thread.cc b/chrome/renderer/mock_render_thread.cc index 050774e..0f9db0d 100644 --- a/chrome/renderer/mock_render_thread.cc +++ b/chrome/renderer/mock_render_thread.cc @@ -43,15 +43,16 @@ bool MockRenderThread::Send(IPC::Message* msg) { // through this function messages, messages with reply and reply messages. // We can only handle one synchronous message at a time. if (msg->is_reply()) { - if (reply_deserializer_) { + if (reply_deserializer_.get()) { reply_deserializer_->SerializeOutputParameters(*msg); - delete reply_deserializer_; - reply_deserializer_ = NULL; + reply_deserializer_.reset(); } } else { if (msg->is_sync()) { - reply_deserializer_ = - static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer(); + // We actually need to handle deleting the reply dersializer for sync + // messages. + reply_deserializer_.reset( + static_cast<IPC::SyncMessage*>(msg)->GetReplyDeserializer()); } OnMessageReceived(*msg); } diff --git a/chrome/renderer/mock_render_thread.h b/chrome/renderer/mock_render_thread.h index 950353a..fc28517 100644 --- a/chrome/renderer/mock_render_thread.h +++ b/chrome/renderer/mock_render_thread.h @@ -108,7 +108,7 @@ class MockRenderThread : public RenderThreadBase { IPC::Channel::Listener* widget_; // The last known good deserializer for sync messages. - IPC::MessageReplyDeserializer* reply_deserializer_; + scoped_ptr<IPC::MessageReplyDeserializer> reply_deserializer_; std::vector<MessagePair> messages_; }; |