Bug 479624 - Use JSAutoTempValueRooter instead of nsAutoGCRoot in nsJSContext::CallEventHandler. r=mrbkap, sr=jst

This commit is contained in:
ben turner 2009-04-17 15:13:08 +02:00
parent 4dbb11d2ec
commit ca8f9d0b93

View File

@ -1957,13 +1957,15 @@ nsJSContext::CallEventHandler(nsISupports* aTarget, void *aScope, void *aHandler
return NS_OK;
}
nsresult rv;
jsval targetVal = JSVAL_VOID;
JSAutoTempValueRooter tvr(mContext, 1, &targetVal);
JSObject* target = nsnull;
nsAutoGCRoot root(&target, &rv);
NS_ENSURE_SUCCESS(rv, rv);
rv = JSObjectFromInterface(aTarget, aScope, &target);
nsresult rv = JSObjectFromInterface(aTarget, aScope, &target);
NS_ENSURE_SUCCESS(rv, rv);
targetVal = OBJECT_TO_JSVAL(target);
jsval rval = JSVAL_VOID;
// This one's a lot easier than EvaluateString because we don't have to