Commit 865c5472 authored by yangguo@chromium.org's avatar yangguo@chromium.org

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
parent 0d1dc27e
......@@ -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<Object>::cast(debug_context_).location());
debug_context_ = Handle<Context>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment