зеркало из https://github.com/mozilla/gecko-dev.git
Move AddRef to before the unlock. (Bug 650674, patch 2) r=bsmedberg
This commit is contained in:
Родитель
a64eb88ab7
Коммит
73a9b73b12
|
@ -475,6 +475,9 @@ nsProxyObject::LockedFind(REFNSIID aIID, void **aResult)
|
||||||
// linked-list check.
|
// linked-list check.
|
||||||
for (peo = mFirst; peo; peo = peo->mNext) {
|
for (peo = mFirst; peo; peo = peo->mNext) {
|
||||||
if (peo->GetClass()->GetProxiedIID().Equals(aIID)) {
|
if (peo->GetClass()->GetProxiedIID().Equals(aIID)) {
|
||||||
|
// Best to AddRef for our caller before unlocking.
|
||||||
|
peo->LockedAddRef();
|
||||||
|
|
||||||
{
|
{
|
||||||
// Deleting an nsProxyEventObject can call Release on an
|
// Deleting an nsProxyEventObject can call Release on an
|
||||||
// nsProxyObject, which can only happen when not holding
|
// nsProxyObject, which can only happen when not holding
|
||||||
|
@ -483,7 +486,6 @@ nsProxyObject::LockedFind(REFNSIID aIID, void **aResult)
|
||||||
delete newpeo;
|
delete newpeo;
|
||||||
}
|
}
|
||||||
*aResult = static_cast<nsISupports*>(peo->mXPTCStub);
|
*aResult = static_cast<nsISupports*>(peo->mXPTCStub);
|
||||||
peo->LockedAddRef();
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче