Ignore:
Timestamp:
Jan 30, 2013, 2:46:54 PM (13 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSContextRef.cpp

    r140619 r141321  
    6767void JSContextGroupRelease(JSContextGroupRef group)
    6868{
    69     toJS(group)->deref();
     69    IdentifierTable* savedIdentifierTable;
     70    JSGlobalData& globalData = *toJS(group);
     71
     72    {
     73        JSLockHolder lock(globalData);
     74        savedIdentifierTable = wtfThreadData().setCurrentIdentifierTable(globalData.identifierTable);
     75        globalData.deref();
     76    }
     77
     78    wtfThreadData().setCurrentIdentifierTable(savedIdentifierTable);
    7079}
    7180
Note: See TracChangeset for help on using the changeset viewer.