Changeset 38375 in webkit for trunk/JavaScriptCore/jsc.cpp


Ignore:
Timestamp:
Nov 13, 2008, 11:50:13 AM (17 years ago)
Author:
[email protected]
Message:

2008-11-13 Cameron Zwarich <[email protected]>

Reviewed by Alexey Proskuryakov.

Perform teardown in the 'jsc' shell in order to suppress annoying and
misleading leak messages. There is still a lone JSC::Node leaking when
quit() is called, but hopefully that can be fixed as well.

  • jsc.cpp: (functionQuit): (main):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jsc.cpp

    r38249 r38375  
    252252}
    253253
    254 JSValue* functionQuit(ExecState*, JSObject*, JSValue*, const ArgList&)
    255 {
     254JSValue* functionQuit(ExecState* exec, JSObject*, JSValue*, const ArgList&)
     255{
     256    {
     257        JSLock lock(false);
     258        JSGlobalData& globalData = exec->globalData();
     259        globalData.heap.destroy();
     260        globalData.deref();
     261    }
     262
    256263    exit(0);
    257264#if !COMPILER(MSVC)
     
    292299
    293300    int res = 0;
     301    RefPtr<JSGlobalData> globalData = JSGlobalData::create();
    294302    TRY
    295         res = jscmain(argc, argv, JSGlobalData::create().releaseRef());
     303        res = jscmain(argc, argv, globalData.get());
    296304    EXCEPT(res = 3)
     305    {
     306        JSLock lock(false);
     307        globalData->heap.destroy();
     308    }
    297309    return res;
    298310}
Note: See TracChangeset for help on using the changeset viewer.