Move AddRef to before the unlock. (Bug 650674, patch 2) r=bsmedberg

This commit is contained in:
L. David Baron 2011-04-20 14:29:45 -07:00
parent 568b1c07ba
commit 31639e67d3

View File

@ -475,6 +475,9 @@ nsProxyObject::LockedFind(REFNSIID aIID, void **aResult)
// linked-list check.
for (peo = mFirst; peo; peo = peo->mNext) {
if (peo->GetClass()->GetProxiedIID().Equals(aIID)) {
// Best to AddRef for our caller before unlocking.
peo->LockedAddRef();
{
// Deleting an nsProxyEventObject can call Release on an
// nsProxyObject, which can only happen when not holding
@ -483,7 +486,6 @@ nsProxyObject::LockedFind(REFNSIID aIID, void **aResult)
delete newpeo;
}
*aResult = static_cast<nsISupports*>(peo->mXPTCStub);
peo->LockedAddRef();
return NS_OK;
}
}