Fix for bug 23781.

This commit is contained in:
nisheeth%netscape.com 2000-01-13 23:32:47 +00:00
parent 2a34c1c86b
commit 9665380540
2 changed files with 8 additions and 8 deletions

View File

@ -173,14 +173,13 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
ListTag(stdout); ListTag(stdout);
printf(": UpdateImage: status=%x\n", aStatus); printf(": UpdateImage: status=%x\n", aStatus);
#endif #endif
nsIPresShell* presShell; nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(&presShell); aPresContext->GetShell(getter_AddRefs(presShell));
if (NS_IMAGE_LOAD_STATUS_ERROR & aStatus) { if (NS_IMAGE_LOAD_STATUS_ERROR & aStatus) {
// We failed to load the image. Notify the pres shell // We failed to load the image. Notify the pres shell
if (presShell) { if (presShell) {
presShell->CantRenderReplacedElement(aPresContext, this); presShell->CantRenderReplacedElement(aPresContext, this);
NS_RELEASE(presShell);
} }
} }
else if (NS_IMAGE_LOAD_STATUS_SIZE_AVAILABLE & aStatus) { else if (NS_IMAGE_LOAD_STATUS_SIZE_AVAILABLE & aStatus) {
@ -192,6 +191,7 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
NS_ASSERTION(0, "No parent to pass the reflow request up to."); NS_ASSERTION(0, "No parent to pass the reflow request up to.");
} }
} }
return NS_OK; return NS_OK;
} }

View File

@ -173,14 +173,13 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
ListTag(stdout); ListTag(stdout);
printf(": UpdateImage: status=%x\n", aStatus); printf(": UpdateImage: status=%x\n", aStatus);
#endif #endif
nsIPresShell* presShell; nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(&presShell); aPresContext->GetShell(getter_AddRefs(presShell));
if (NS_IMAGE_LOAD_STATUS_ERROR & aStatus) { if (NS_IMAGE_LOAD_STATUS_ERROR & aStatus) {
// We failed to load the image. Notify the pres shell // We failed to load the image. Notify the pres shell
if (presShell) { if (presShell) {
presShell->CantRenderReplacedElement(aPresContext, this); presShell->CantRenderReplacedElement(aPresContext, this);
NS_RELEASE(presShell);
} }
} }
else if (NS_IMAGE_LOAD_STATUS_SIZE_AVAILABLE & aStatus) { else if (NS_IMAGE_LOAD_STATUS_SIZE_AVAILABLE & aStatus) {
@ -192,6 +191,7 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
NS_ASSERTION(0, "No parent to pass the reflow request up to."); NS_ASSERTION(0, "No parent to pass the reflow request up to.");
} }
} }
return NS_OK; return NS_OK;
} }