From 4ab3270dd5f4cc92fd6f4d443b531468919b9760 Mon Sep 17 00:00:00 2001 From: "svenpanne@chromium.org" Date: Thu, 6 Feb 2014 12:09:08 +0000 Subject: [PATCH] Fixed space leak in DebuggerAgentSession. Ownership in this part is still very convoluted and should probably be cleaned up, this is only the minimal CL needed to fix the leak. R=yangguo@chromium.org Review URL: https://codereview.chromium.org/153623009 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19148 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/debug-agent.cc | 5 +++++ src/debug-agent.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/debug-agent.cc b/src/debug-agent.cc index d3d22c9133..49790cee99 100644 --- a/src/debug-agent.cc +++ b/src/debug-agent.cc @@ -173,6 +173,11 @@ void DebuggerAgent::DebuggerMessage(const v8::Debug::Message& message) { } +DebuggerAgentSession::~DebuggerAgentSession() { + delete client_; +} + + void DebuggerAgent::OnSessionClosed(DebuggerAgentSession* session) { // Don't do anything during termination. if (terminate_) { diff --git a/src/debug-agent.h b/src/debug-agent.h index 138e51acc6..e81e4cd6aa 100644 --- a/src/debug-agent.h +++ b/src/debug-agent.h @@ -83,6 +83,7 @@ class DebuggerAgentSession: public Thread { DebuggerAgentSession(DebuggerAgent* agent, Socket* client) : Thread("v8:DbgAgntSessn"), agent_(agent), client_(client) {} + ~DebuggerAgentSession(); void DebuggerMessage(Vector message); void Shutdown();