Bug 485834 ObserverService shouldn't recurse infinitely for stupid consumers

r=dougt
This commit is contained in:
timeless@mozdev.org 2009-08-12 11:49:52 +02:00
parent b7026b73e3
commit e614edadb8

View File

@ -147,6 +147,9 @@ nsObserverService::RemoveObserver(nsIObserver* anObserver, const char* aTopic)
if (!observerList)
return NS_ERROR_FAILURE;
/* This death grip is to protect against stupid consumers who call
RemoveObserver from their Destructor, see bug 485834/bug 325392. */
nsCOMPtr<nsIObserver> kungFuDeathGrip(anObserver);
return observerList->RemoveObserver(anObserver);
}