diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 23:01:52 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-05 23:01:52 +0000 |
commit | be930259c6ff84c0211298c0cdeecbf5d4863850 (patch) | |
tree | 9365d311a6069e4b8b5870021df33cb031b3b318 /views/window | |
parent | 98f6e021fb2b5c53a1b77ca17501e54d9dfd2b7e (diff) | |
download | chromium_src-be930259c6ff84c0211298c0cdeecbf5d4863850.zip chromium_src-be930259c6ff84c0211298c0cdeecbf5d4863850.tar.gz chromium_src-be930259c6ff84c0211298c0cdeecbf5d4863850.tar.bz2 |
Fix crash in window shutdown by accessing the Widget via a more unique property.
http://crbug.com/12156
TEST=none
Review URL: http://codereview.chromium.org/118196
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17789 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/window')
-rw-r--r-- | views/window/window_win.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/views/window/window_win.cc b/views/window/window_win.cc index 6b9f5d8..12ef674 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -191,8 +191,8 @@ static BOOL CALLBACK SendDwmCompositionChanged(HWND window, LPARAM param) { } // namespace void WindowWin::FrameTypeChanged() { - // If we're not on Aero Glass, we don't care doing any of the DWM stuff. Just - // tell the NCV to update and leave it there. + // If we're not on Aero Glass, we don't care about doing any of the DWM stuff. + // Just tell the NCV to update and leave it there. if (!win_util::ShouldUseVistaFrame()) { non_client_view_->UpdateFrame(); return; @@ -1372,8 +1372,13 @@ void WindowWin::InitClass() { namespace { // static static BOOL CALLBACK WindowCallbackProc(HWND hwnd, LPARAM lParam) { - WidgetWin* widget = reinterpret_cast<WidgetWin*>( - win_util::GetWindowUserData(hwnd)); + // This is safer than calling GetWindowUserData, since it looks specifically + // for the RootView window property which should be unique. + RootView* root_view = GetRootViewForHWND(hwnd); + if (!root_view) + return TRUE; + + Widget* widget = root_view->GetWidget(); if (!widget) return TRUE; |