Chromium Code Reviews

Unified Diff: src/api.cc

Issue 101733002: Fixed global object leak (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ASSERT that Global is not called after detaching the global object Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index aee9e3a469eae454a9fdc7b241142050044a730a..073ee2a9cff38ce9d2dd5f910d95007295a4e100 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -5410,6 +5410,7 @@ v8::Local<v8::Object> Context::Global() {
i::Handle<i::Context> context = Utils::OpenHandle(this);
i::Isolate* isolate = context->GetIsolate();
i::Handle<i::Object> global(context->global_proxy(), isolate);
+ ASSERT(!i::Handle<i::JSGlobalProxy>::cast(global)->IsDetached());
return Utils::ToLocal(i::Handle<i::JSObject>::cast(global));
}
@@ -5422,16 +5423,6 @@ void Context::DetachGlobal() {
}
-void Context::ReattachGlobal(Handle<Object> global_object) {
- i::Handle<i::Context> context = Utils::OpenHandle(this);
- i::Isolate* isolate = context->GetIsolate();
- ENTER_V8(isolate);
- i::Handle<i::JSGlobalProxy> global_proxy =
- i::Handle<i::JSGlobalProxy>::cast(Utils::OpenHandle(*global_object));
- isolate->bootstrapper()->ReattachGlobal(context, global_proxy);
-}
-
-
void Context::AllowCodeGenerationFromStrings(bool allow) {
i::Handle<i::Context> context = Utils::OpenHandle(this);
i::Isolate* isolate = context->GetIsolate();
« no previous file with comments | « include/v8.h ('k') | src/bootstrapper.h » ('j') | test/cctest/test-object-observe.cc » ('J')

Powered by Google App Engine