Defensive programming for UnregisterObserver after Shutdown. r=dbaron

This commit is contained in:
warren%netscape.com 2000-07-11 06:56:06 +00:00
Родитель bd8d457314
Коммит 4157de5421
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -159,7 +159,9 @@ nsMemoryImpl::RegisterObserver(nsIMemoryPressureObserver* obs)
NS_IMETHODIMP
nsMemoryImpl::UnregisterObserver(nsIMemoryPressureObserver* obs)
{
NS_ASSERTION(mObservers, "never called RegisterObserver");
NS_ASSERTION(mObservers, "never called nsIMemory::RegisterObserver or called after nsIMemory::Shutdown");
if (!mObservers)
return NS_OK;
return mObservers->RemoveElement(obs);
}