Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: src/v8.cc

Issue 23775007: Fix multiple V8::Dispose calls since r16563. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8.cc
diff --git a/src/v8.cc b/src/v8.cc
index d9ce8404acddea3391c511ee03ce20e475a27055..c4ce0629c8021b89d39f59c8703dc64371330bb8 100644
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -63,8 +63,8 @@ bool V8::Initialize(Deserializer* des) {
// The current thread may not yet had entered an isolate to run.
// Note the Isolate::Current() may be non-null because for various
- // initialization purposes an initializing thread may be assigned an isolate
- // but not actually enter it.
+ // initialization purposes an initializing thread may be assigned an
+ // isolate but not actually enter it.
if (i::Isolate::CurrentPerIsolateThreadData() == NULL) {
i::Isolate::EnterDefaultIsolate();
}
@@ -84,6 +84,15 @@ bool V8::Initialize(Deserializer* des) {
void V8::TearDown() {
+ // The current thread may not yet had entered an isolate to run or may
+ // have already disposed the entered isolated before.
+ // Note the Isolate::Current() may be non-null because for various
+ // initialization purposes an initializing thread may be assigned an
+ // isolate but not actually enter it.
+ if (i::Isolate::CurrentPerIsolateThreadData() == NULL) {
+ return;
+ }
+
Isolate* isolate = Isolate::Current();
ASSERT(isolate->IsDefaultIsolate());
if (!isolate->IsInitialized()) return;
@@ -91,6 +100,7 @@ void V8::TearDown() {
// The isolate has to be torn down before clearing the LOperand
// caches so that the optimizing compiler thread (if running)
// doesn't see an inconsistent view of the lithium instructions.
+ Isolate::SetIsolateThreadLocals(isolate, NULL);
Sven Panne 2013/09/06 10:48:27 This looks a bit strange, but to be honest, I don'
isolate->TearDown();
delete isolate;
« no previous file with comments | « src/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698