зеркало из https://github.com/mozilla/pjs.git
Changed destructor to release reference to image request observer objects. This
fixes a memory leak
This commit is contained in:
Родитель
a47aaaee75
Коммит
7c078d1211
|
@ -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
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче