Revision: 16565
Author:   [email protected]
Date:     Fri Sep  6 11:02:43 2013 UTC
Log:      Fix multiple V8::Dispose calls since r16563.

[email protected]
BUG=v8:2744
TEST=cctest/test-api/InitializeAndDisposeMultiple

Review URL: https://codereview.chromium.org/23775007
http://code.google.com/p/v8/source/detail?r=16565

Modified:
 /branches/bleeding_edge/src/isolate.h
 /branches/bleeding_edge/src/v8.cc

=======================================
--- /branches/bleeding_edge/src/isolate.h       Tue Sep  3 11:47:16 2013 UTC
+++ /branches/bleeding_edge/src/isolate.h       Fri Sep  6 11:02:43 2013 UTC
@@ -1383,6 +1383,7 @@
   friend class v8::Isolate;
   friend class v8::Locker;
   friend class v8::Unlocker;
+  friend class V8;

   DISALLOW_COPY_AND_ASSIGN(Isolate);
 };
=======================================
--- /branches/bleeding_edge/src/v8.cc   Thu Sep  5 18:53:39 2013 UTC
+++ /branches/bleeding_edge/src/v8.cc   Fri Sep  6 11:02:43 2013 UTC
@@ -63,8 +63,8 @@

   // 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 @@


 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 @@
   // 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);
   isolate->TearDown();
   delete isolate;

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to