Changed destructor to release reference to image request observer objects. This

fixes a memory leak
This commit is contained in:
troy%netscape.com 1998-08-09 16:53:24 +00:00
Родитель a47aaaee75
Коммит 7c078d1211
1 изменённых файлов: 13 добавлений и 1 удалений

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

@ -37,7 +37,19 @@ ImageRequestImpl::ImageRequestImpl()
ImageRequestImpl::~ImageRequestImpl()
{
// Delete the list of observers, and release the reference to the image
// request observer object
if (nsnull != mObservers) {
for (PRInt32 cnt = 0; cnt < mObservers->Count(); cnt++)
{
nsIImageRequestObserver* observer;
observer = (nsIImageRequestObserver*)mObservers->ElementAt(cnt);
NS_IF_RELEASE(observer);
mObservers->ReplaceElementAt(nsnull, cnt);
}
delete mObservers;
}
// XP Observer list destroyed by the image library
}