mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 961551, part 1 - Add root wrappers to the map in XPCWrappedJS ctor. r=bholley
This commit is contained in:
parent
9c10beed0d
commit
7219645381
@ -361,10 +361,7 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj,
|
||||
// build the root wrapper
|
||||
if (rootJSObj == jsObj) {
|
||||
// the root will do double duty as the interface wrapper
|
||||
wrapper = root = new nsXPCWrappedJS(cx, jsObj, clasp, nullptr);
|
||||
|
||||
map->Add(cx, root);
|
||||
|
||||
wrapper = new nsXPCWrappedJS(cx, jsObj, clasp, nullptr);
|
||||
*wrapperResult = wrapper;
|
||||
return NS_OK;
|
||||
} else {
|
||||
@ -379,8 +376,6 @@ nsXPCWrappedJS::GetNewOrUsed(JS::HandleObject jsObj,
|
||||
NS_RELEASE(rootClasp);
|
||||
|
||||
release_root = true;
|
||||
|
||||
map->Add(cx, root);
|
||||
}
|
||||
}
|
||||
|
||||
@ -415,7 +410,9 @@ nsXPCWrappedJS::nsXPCWrappedJS(JSContext* cx,
|
||||
NS_ADDREF_THIS();
|
||||
NS_ADDREF_THIS();
|
||||
|
||||
if (!IsRootWrapper()) {
|
||||
if (IsRootWrapper()) {
|
||||
nsXPConnect::GetRuntimeInstance()->GetWrappedJSMap()->Add(cx, this);
|
||||
} else {
|
||||
NS_ADDREF(mRoot);
|
||||
mNext = mRoot->mNext;
|
||||
mRoot->mNext = this;
|
||||
|
Loading…
Reference in New Issue
Block a user