Title: [141321] trunk/Source/_javascript_Core
Revision
141321
Author
mhahnenb...@apple.com
Date
2013-01-30 14:46:54 -0800 (Wed, 30 Jan 2013)

Log Message

Objective-C API: JSContext's dealloc causes ASSERT due to ordering of releases
https://bugs.webkit.org/show_bug.cgi?id=107978

Reviewed by Filip Pizlo.

We need to add the Identifier table save/restore in JSContextGroupRelease so that we 
have the correct table if we end up destroying the JSGlobalData/Heap.

* API/JSContextRef.cpp:
(JSContextGroupRelease):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/API/JSContextRef.cpp (141320 => 141321)


--- trunk/Source/_javascript_Core/API/JSContextRef.cpp	2013-01-30 22:45:33 UTC (rev 141320)
+++ trunk/Source/_javascript_Core/API/JSContextRef.cpp	2013-01-30 22:46:54 UTC (rev 141321)
@@ -66,7 +66,16 @@
 
 void JSContextGroupRelease(JSContextGroupRef group)
 {
-    toJS(group)->deref();
+    IdentifierTable* savedIdentifierTable;
+    JSGlobalData& globalData = *toJS(group);
+
+    {
+        JSLockHolder lock(globalData);
+        savedIdentifierTable = wtfThreadData().setCurrentIdentifierTable(globalData.identifierTable);
+        globalData.deref();
+    }
+
+    wtfThreadData().setCurrentIdentifierTable(savedIdentifierTable);
 }
 
 // From the API's perspective, a global context remains alive iff it has been JSGlobalContextRetained.

Modified: trunk/Source/_javascript_Core/ChangeLog (141320 => 141321)


--- trunk/Source/_javascript_Core/ChangeLog	2013-01-30 22:45:33 UTC (rev 141320)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-01-30 22:46:54 UTC (rev 141321)
@@ -1,5 +1,18 @@
 2013-01-30  Mark Hahnenberg  <mhahnenb...@apple.com>
 
+        Objective-C API: JSContext's dealloc causes ASSERT due to ordering of releases
+        https://bugs.webkit.org/show_bug.cgi?id=107978
+
+        Reviewed by Filip Pizlo.
+
+        We need to add the Identifier table save/restore in JSContextGroupRelease so that we 
+        have the correct table if we end up destroying the JSGlobalData/Heap.
+
+        * API/JSContextRef.cpp:
+        (JSContextGroupRelease):
+
+2013-01-30  Mark Hahnenberg  <mhahnenb...@apple.com>
+
         Objective-C API: exceptionHandler needs to be released in JSContext dealloc
         https://bugs.webkit.org/show_bug.cgi?id=108378
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to