mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 941766 - Fix an exact rooting hazard in NPAPI; r=johns
--HG-- extra : rebase_source : f82a0e94f689ce0c5b88e05d9ae56ef52ce2f662
This commit is contained in:
parent
cef6a4d1df
commit
4966a3b266
@ -1007,11 +1007,8 @@ nsJSObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, JS::Handle<JSObject*> obj)
|
||||
}
|
||||
}
|
||||
|
||||
nsJSObjWrapperKey key(obj, npp);
|
||||
|
||||
JSObjWrapperTable::AddPtr p = sJSObjWrappers.lookupForAdd(key);
|
||||
|
||||
if (p/* && p->value()*/) {
|
||||
JSObjWrapperTable::Ptr p = sJSObjWrappers.lookupForAdd(nsJSObjWrapperKey(obj, npp));
|
||||
if (p) {
|
||||
MOZ_ASSERT(p->value());
|
||||
// Found a live nsJSObjWrapper, return it.
|
||||
|
||||
@ -1030,7 +1027,8 @@ nsJSObjWrapper::GetNewOrUsed(NPP npp, JSContext *cx, JS::Handle<JSObject*> obj)
|
||||
|
||||
wrapper->mJSObj = obj;
|
||||
|
||||
if (!sJSObjWrappers.add(p, key, wrapper)) {
|
||||
nsJSObjWrapperKey key(obj, npp);
|
||||
if (!sJSObjWrappers.putNew(key, wrapper)) {
|
||||
// Out of memory, free the wrapper we created.
|
||||
_releaseobject(wrapper);
|
||||
return nullptr;
|
||||
|
Loading…
Reference in New Issue
Block a user