Bug 868130 - Make sure to push the context in the ObjectWrapperChild constructor. r=gabor

This commit is contained in:
Bobby Holley 2013-05-22 10:05:24 -06:00
parent 750d6364fd
commit cfe8b9c5d2

View File

@ -115,6 +115,7 @@ ObjectWrapperChild::CheckOperation(JSContext*,
ObjectWrapperChild::ObjectWrapperChild(JSContext* cx, JSObject* obj)
: mObj(obj)
{
AutoContextPusher acp(cx);
JSAutoRequest request(cx);
#ifdef DEBUG
bool added =
@ -127,6 +128,7 @@ void
ObjectWrapperChild::ActorDestroy(ActorDestroyReason why)
{
JSContext* cx = Manager()->GetContext();
AutoContextPusher acp(cx);
JSAutoRequest request(cx);
JS_RemoveObjectRoot(cx, &mObj);
}