From b6ecfa38ff76e5353f96963c050901f8c5fa546e Mon Sep 17 00:00:00 2001 From: "ben@chromium.org" Date: Wed, 4 Feb 2009 20:06:26 +0000 Subject: Paper over a crash that I think is due to the way we shut down the view hierarchy in a window. http://crbug.com/6260 Review URL: http://codereview.chromium.org/20051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9165 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/views/custom_frame_window.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'chrome/views') diff --git a/chrome/views/custom_frame_window.cc b/chrome/views/custom_frame_window.cc index e80c384..2cf6ccd 100644 --- a/chrome/views/custom_frame_window.cc +++ b/chrome/views/custom_frame_window.cc @@ -674,6 +674,13 @@ void DefaultNonClientView::PaintMaximizedFrameBorder( void DefaultNonClientView::PaintTitleBar(ChromeCanvas* canvas) { WindowDelegate* d = container_->window_delegate(); + + // It seems like in some conditions we can be asked to paint after the window + // that contains us is WM_DESTROYed. At this point, our delegate is NULL. The + // correct long term fix may be to shut down the RootView in WM_DESTROY. + if (!d) + return; + canvas->DrawStringInt(d->GetWindowTitle(), title_font_, SK_ColorWHITE, MirroredLeftPointForRect(title_bounds_), title_bounds_.y(), title_bounds_.width(), title_bounds_.height()); -- cgit v1.1