Bug 898871 - Hold a strong ref on the pres shell while scrolling, check for damage afterwards. r=roc

This commit is contained in:
Mats Palmgren 2013-08-08 22:04:58 +00:00
parent 6cfd0db25c
commit 501b3308d9

View File

@ -344,6 +344,11 @@ ImageDocument::ShrinkToFit()
// origin now that we're showing a shrunk-to-window version.
ScrollImageTo(0, 0, false);
if (!mImageContent) {
// ScrollImageTo flush destroyed our content.
return;
}
SetModeClass(eShrinkToFit);
mImageIsResized = true;
@ -375,7 +380,7 @@ ImageDocument::ScrollImageTo(int32_t aX, int32_t aY, bool restoreImage)
FlushPendingNotifications(Flush_Layout);
}
nsIPresShell *shell = GetShell();
nsCOMPtr<nsIPresShell> shell = GetShell();
if (!shell)
return;