From a5f0489e5d5c86f867411424d4f721c0ff6c683b Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Mon, 26 May 2014 08:05:04 +0000 Subject: [PATCH] Fix memory leak in the debugger. R=jarin@chromium.org Review URL: https://codereview.chromium.org/297373002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21479 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/debug.cc | 3 ++- src/isolate.cc | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/debug.cc b/src/debug.cc index 900821bea..0af63f61f 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -805,6 +805,8 @@ bool Debug::Load() { void Debug::Unload() { + ClearAllBreakPoints(); + // Return debugger is not loaded. if (!IsLoaded()) return; @@ -3150,7 +3152,6 @@ void Debugger::UpdateState() { activate = debug->Load(); } else if (debug->IsLoaded() && !activate) { isolate_->compilation_cache()->Enable(); - debug->ClearAllBreakPoints(); debug->Unload(); } is_active_ = activate; diff --git a/src/isolate.cc b/src/isolate.cc index 9572046a4..86e60e2c7 100644 --- a/src/isolate.cc +++ b/src/isolate.cc @@ -1562,6 +1562,8 @@ void Isolate::Deinit() { if (state_ == INITIALIZED) { TRACE_ISOLATE(deinit); + debug()->Unload(); + if (concurrent_recompilation_enabled()) { optimizing_compiler_thread_->Stop(); delete optimizing_compiler_thread_; -- 2.34.1