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


Ignore:
Timestamp:
Nov 13, 2008, 7:45:32 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Sam Weinig.

In r38375 the 'jsc' shell was changed to improve teardown on quit. The
main() function in jsc.cpp uses Structured Exception Handling, so Visual
C++ emits a warning when destructors are used.


In order to speculatively fix the Windows build, this patch changes that
code to use explicit pointer manipulation and locking rather than smart
pointers and RAII.

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

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jsc.cpp

    r38375 r38381  
    298298#endif
    299299
     300    // We can't use destructors in the following code because it uses Windows
     301    // Structured Exception Handling
    300302    int res = 0;
    301     RefPtr<JSGlobalData> globalData = JSGlobalData::create();
     303    JSGlobalData* globalData = JSGlobalData::create().releaseRef();
    302304    TRY
    303         res = jscmain(argc, argv, globalData.get());
     305        res = jscmain(argc, argv, globalData);
    304306    EXCEPT(res = 3)
    305     {
    306         JSLock lock(false);
    307         globalData->heap.destroy();
    308     }
     307
     308    JSLock::lock(false);
     309    globalData->heap.destroy();
     310    JSLock::unlock(false);
     311
     312    globalData->deref();
    309313    return res;
    310314}
Note: See TracChangeset for help on using the changeset viewer.