diff --git a/js/src/ipc/ObjectWrapperParent.cpp b/js/src/ipc/ObjectWrapperParent.cpp index 92980cf326a1..1c1455a0c151 100644 --- a/js/src/ipc/ObjectWrapperParent.cpp +++ b/js/src/ipc/ObjectWrapperParent.cpp @@ -203,8 +203,10 @@ const JSExtendedClass ObjectWrapperParent::sCPOW_JSClass = { void ObjectWrapperParent::ActorDestroy(ActorDestroyReason) { - if (mObj) + if (mObj) { mObj->setPrivate(NULL); + mObj = NULL; + } } ContextWrapperParent* @@ -635,8 +637,10 @@ ObjectWrapperParent::CPOW_Finalize(JSContext* cx, JSObject* obj) CPOW_LOG(("Calling CPOW_Finalize...")); ObjectWrapperParent* self = Unwrap(cx, obj); - if (self) + if (self) { + self->mObj = NULL; ObjectWrapperParent::Send__delete__(self); + } } /*static*/ JSBool