Fix leak when a window holding an image document is closed before the image

finishes loading.  Bug 237153, r+sr=jst, a=race between dbaron and brendan.
This commit is contained in:
bzbarsky%mit.edu 2004-03-11 20:47:51 +00:00
Родитель 6fcd42e796
Коммит 67671e4852
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -268,7 +268,12 @@ nsImageDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObjec
PR_FALSE);
}
// drop the ref to mImageElement, in case it has a ref to us
// Break reference cycle with mImageElement, if we have one
nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mImageElement);
if (imageLoader) {
imageLoader->RemoveObserver(this);
}
mImageElement = nsnull;
}