mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-26 18:31:29 +00:00
Fix bug 345535: crash [@js_GetSlotThreadSafe]. r/sr=brendan.
This commit is contained in:
parent
f34bf9bf8a
commit
a36f9ead4e
@ -81,14 +81,16 @@ nsJSEventListener::nsJSEventListener(nsIScriptContext *aContext,
|
||||
: nsIJSEventListener(aContext, aScopeObject, aTarget),
|
||||
mReturnResult(nsReturnResult_eNotSet)
|
||||
{
|
||||
// mScopeObject is the "script global" for a context - this
|
||||
// does not need explicit memory management so long we we don't
|
||||
// outlive the context - which we don't.
|
||||
// aScopeObject is the inner window's JS object, which we need to lock
|
||||
// until we are done with it.
|
||||
NS_ASSERTION(aScopeObject && aContext,
|
||||
"EventListener with no context or scope?");
|
||||
aContext->HoldScriptObject(aScopeObject);
|
||||
}
|
||||
|
||||
nsJSEventListener::~nsJSEventListener()
|
||||
{
|
||||
// as above, no need to "drop" our reference...
|
||||
mContext->DropScriptObject(mScopeObject);
|
||||
}
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsJSEventListener)
|
||||
@ -201,9 +203,9 @@ nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||
iargv = do_QueryInterface(tempargv);
|
||||
}
|
||||
|
||||
// XXX [The JSContext inside mContext] doesn't seem like the correct
|
||||
// context on which to execute the event handler. Might need to get one
|
||||
// from the JS thread context stack.
|
||||
// FIXME: bug 347480 - [The JSContext inside mContext] doesn't seem like
|
||||
// the correct context on which to execute the event handler. Might need to
|
||||
// get one from the JS thread context stack.
|
||||
nsCOMPtr<nsIVariant> vrv;
|
||||
rv = mContext->CallEventHandler(mTarget, mScopeObject, funcval, iargv,
|
||||
getter_AddRefs(vrv));
|
||||
|
Loading…
Reference in New Issue
Block a user