Changeset 24559 in webkit


Ignore:
Timestamp:
Jul 23, 2007 8:01:26 PM (17 years ago)
Author:
andersca
Message:

Reviewed by Geoff.

<rdar://problem/5121461> REGRESSION: Unable to load JigZone puzzle


  • bindings/jni/jni_jsobject.cpp: (JavaJSObject::createNative):


Call RootObject::gcProtect on the global object, thereby putting it in the
"protect count" set which is used for checking if a native handle is valid.

Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r24546 r24559  
     12007-07-23  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Geoff.
     4
     5        <rdar://problem/5121461> REGRESSION: Unable to load JigZone puzzle
     6       
     7        * bindings/jni/jni_jsobject.cpp:
     8        (JavaJSObject::createNative):
     9       
     10        Call RootObject::gcProtect on the global object, thereby putting it in the
     11        "protect count" set which is used for checking if a native handle is valid.
     12       
    1132007-07-23  Darin Adler  <darin@apple.com>
    214
  • trunk/JavaScriptCore/bindings/jni/jni_jsobject.cpp

    r23538 r24559  
    338338    // otherwise we are being called after creating a JavaJSObject in
    339339    // JavaJSObject::convertValueToJObject().
    340     if (rootObject)
    341         return ptr_to_jlong(rootObject->interpreter()->globalObject());
    342 
     340    if (rootObject) {
     341        JSObject* globalObject = rootObject->interpreter()->globalObject();
     342        // We call gcProtect here to get the object into the root object's "protect set" which
     343        // is used to test if a native handle is valid as well as getting the root object given the handle.
     344        rootObject->gcProtect(globalObject);
     345        return ptr_to_jlong(globalObject);
     346    }
     347   
    343348    return nativeHandle;
    344349}
Note: See TracChangeset for help on using the changeset viewer.