зеркало из https://github.com/mozilla/pjs.git
Fixing bug 414658. Make sure to not use a context from a different thread when calling functions on a wrapped JS object. r+sr=peterv@propagandism.org
This commit is contained in:
Родитель
f6ee1305cb
Коммит
f72959f97b
|
@ -516,7 +516,15 @@ GetContextFromObject(JSObject *obj)
|
|||
XPCWrappedNativeScope* scope =
|
||||
XPCWrappedNativeScope::FindInJSObjectScope(ccx, obj);
|
||||
XPCContext *xpcc = scope->GetContext();
|
||||
return xpcc ? xpcc->GetJSContext() : nsnull;
|
||||
|
||||
if(xpcc)
|
||||
{
|
||||
JSContext *cx = xpcc->GetJSContext();
|
||||
if(cx->thread->id == js_CurrentThreadId())
|
||||
return cx;
|
||||
}
|
||||
|
||||
return nsnull;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
|
Загрузка…
Ссылка в новой задаче