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 2e08885c40
commit e8d172db93

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);
}