Bug 952660, part 8 - Insert non-root wrappers into the list in the constructor for nsXPCWrappedJS. r=bholley

A non-root wrapper has to be inserted into the list. There's only one place this is needed, but I
think it makes more sense like this.
This commit is contained in:
Andrew McCreight 2014-01-02 11:33:42 -08:00
parent 13bc621ff8
commit 0ac48b918c

View File

@ -391,9 +391,6 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj,
wrapper = new nsXPCWrappedJS(cx, jsObj, clazz, root);
wrapper->mNext = root->mNext;
root->mNext = wrapper;
if (release_root)
NS_RELEASE(root);
@ -418,9 +415,11 @@ nsXPCWrappedJS::nsXPCWrappedJS(JSContext* cx,
NS_ADDREF_THIS();
NS_ADDREF_THIS();
if (!IsRootWrapper())
if (!IsRootWrapper()) {
NS_ADDREF(mRoot);
mNext = mRoot->mNext;
mRoot->mNext = this;
}
}
nsXPCWrappedJS::~nsXPCWrappedJS()