Lookup the view again since WillPaint() might lead to its destruction. b=378273 r+sr=roc

This commit is contained in:
mats.palmgren@bredband.net 2007-04-29 17:46:27 -07:00
parent 731778235e
commit a8c8911056

View File

@ -1215,6 +1215,10 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS
BeginUpdateViewBatch();
observer->WillPaint();
EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
// Get the view pointer again since the code above might have
// destroyed it (bug 378273).
view = nsView::GetViewFor(aEvent->widget);
}
}
// Make sure to sync up any widget geometry changes we
@ -1222,8 +1226,11 @@ NS_IMETHODIMP nsViewManager::DispatchEvent(nsGUIEvent *aEvent, nsEventStatus *aS
if (rootVM->mHasPendingUpdates) {
rootVM->ProcessPendingUpdates(mRootView, PR_FALSE);
}
Refresh(view, event->renderingContext, region,
NS_VMREFRESH_DOUBLE_BUFFER);
if (view) {
Refresh(view, event->renderingContext, region,
NS_VMREFRESH_DOUBLE_BUFFER);
}
}
} else {
// since we got an NS_PAINT event, we need to