From: yangguo@chromium.org Date: Mon, 26 May 2014 11:40:34 +0000 (+0000) Subject: Actually fix the memory leak in debugger wrt promises. X-Git-Tag: upstream/4.7.83~8977 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=865c54725f5ea36c3c4cc662eb9339e956a4ab91;p=platform%2Fupstream%2Fv8.git Actually fix the memory leak in debugger wrt promises. In the fuzz test the debugger is not actually loaded... R=jkummerow@chromium.org Review URL: https://codereview.chromium.org/304453003 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21491 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/debug.cc b/src/debug.cc index b4421d6..80f993b 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -807,15 +807,15 @@ bool Debug::Load() { void Debug::Unload() { ClearAllBreakPoints(); + // Match unmatched PromiseHandlePrologue calls. + while (thread_local_.promise_on_stack_) PromiseHandleEpilogue(); + // Return debugger is not loaded. if (!IsLoaded()) return; // Clear the script cache. DestroyScriptCache(); - // Match unmatched PromiseHandlePrologue calls. - while (thread_local_.promise_on_stack_) PromiseHandleEpilogue(); - // Clear debugger context global handle. GlobalHandles::Destroy(Handle::cast(debug_context_).location()); debug_context_ = Handle();