mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 897676 - Null out |si| if we end up using that of the proto in WrapNewGlobal. r=mrbkap
This commit is contained in:
parent
dbea38ef61
commit
dc8ec482b2
@ -360,7 +360,13 @@ XPCWrappedNative::WrapNewGlobal(xpcObjectHelper &nativeHelper,
|
||||
XPCNativeScriptableInfo* siProto = proto->GetScriptableInfo();
|
||||
if (siProto && siProto->GetCallback() == sciWrapper.GetCallback()) {
|
||||
wrapper->mScriptableInfo = siProto;
|
||||
// XPCNativeScriptableShared instances live in a map, and are
|
||||
// GCed, but XPCNativeScriptableInfo is per-instance and must be
|
||||
// manually managed. If we're switching over to that of the proto, we
|
||||
// need to destroy the one we've allocated, and also null out the
|
||||
// AutoMarkingPtr, so that it doesn't try to mark garbage data.
|
||||
delete si;
|
||||
si = nullptr;
|
||||
} else {
|
||||
wrapper->mScriptableInfo = si;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user