mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 514077 - Make XPCNativeWrappers' parent chains follow their wrapped native's chains when they change. r=jorendorff
This commit is contained in:
parent
df5f435eac
commit
b16ad5ed0a
@ -1650,9 +1650,20 @@ XPCWrappedNative::ReparentWrapperIfFound(XPCCallContext& ccx,
|
||||
|
||||
// Now we can just fix up the parent and return the wrapper
|
||||
|
||||
if(aNewParent && !JS_SetParent(ccx, flat, aNewParent))
|
||||
if(aNewParent)
|
||||
{
|
||||
if(!JS_SetParent(ccx, flat, aNewParent))
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
JSObject *nw;
|
||||
if(wrapper &&
|
||||
(nw = wrapper->GetWrapper()) &&
|
||||
!JS_SetParent(ccx, nw, JS_GetGlobalForObject(ccx, aNewParent)))
|
||||
{
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
*aWrapper = nsnull;
|
||||
wrapper.swap(*aWrapper);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user