Bug 805745. Re-get the view after calling PaintWindow because it can flush (via WillPaint). r=mattwoodrow

This commit is contained in:
Timothy Nikkel 2012-12-12 15:57:08 -06:00
parent bd370be6ed
commit 480d0fe63b

View File

@ -1051,10 +1051,17 @@ nsView::WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint)
bool
nsView::PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion, uint32_t aFlags)
{
NS_ASSERTION(this == nsView::GetViewFor(aWidget), "wrong view for widget?");
mInAlternatePaint = aFlags & PAINT_IS_ALTERNATE;
nsCOMPtr<nsViewManager> vm = mViewManager;
bool result = vm->PaintWindow(aWidget, aRegion, aFlags);
mInAlternatePaint = false;
// PaintWindow can destroy this via WillPaintWindow notification, so we have
// to re-get the view from the widget.
nsView* view = nsView::GetViewFor(aWidget);
if (view) {
view->mInAlternatePaint = false;
}
return result;
}