Bug 952840 - Remove scope from XPCWN::FindTearOff. r=bholley

This commit is contained in:
Andrew McCreight 2014-01-06 17:35:54 -08:00
parent 01f8bc9e65
commit 022e4a0e0b

View File

@ -1513,8 +1513,6 @@ XPCWrappedNative::FindTearOff(XPCNativeInterface* aInterface,
to = newChunk->mTearOffs; to = newChunk->mTearOffs;
} }
{
// Scope keeps |tearoff| from leaking across the rest of the function.
AutoMarkingWrappedNativeTearOffPtr tearoff(cx, to); AutoMarkingWrappedNativeTearOffPtr tearoff(cx, to);
rv = InitTearOff(to, aInterface, needJSObject); rv = InitTearOff(to, aInterface, needJSObject);
// During shutdown, we don't sweep tearoffs. So make sure to unmark // During shutdown, we don't sweep tearoffs. So make sure to unmark
@ -1523,7 +1521,6 @@ XPCWrappedNative::FindTearOff(XPCNativeInterface* aInterface,
to->Unmark(); to->Unmark();
if (NS_FAILED(rv)) if (NS_FAILED(rv))
to = nullptr; to = nullptr;
}
if (pError) if (pError)
*pError = rv; *pError = rv;