Index: ui/platform_window/win/win_window.cc |
diff --git a/ui/platform_window/win/win_window.cc b/ui/platform_window/win/win_window.cc |
index debf105c11a7d4cf73a378adefc2eac2c958e238..af3f49e729fe88339625bd1d5e9e88db7ed3fb1d 100644 |
--- a/ui/platform_window/win/win_window.cc |
+++ b/ui/platform_window/win/win_window.cc |
@@ -38,7 +38,7 @@ gfx::Rect GetWindowBoundsForClientBounds(DWORD style, DWORD ex_style, |
WinWindow::WinWindow(PlatformWindowDelegate* delegate, |
const gfx::Rect& bounds) |
- : delegate_(delegate) { |
+ : delegate_(delegate), destroyed_(false) { |
CHECK(delegate_); |
if (use_popup_as_root_window_for_test) |
set_window_style(WS_POPUP); |
@@ -177,6 +177,11 @@ LRESULT WinWindow::OnCreate(CREATESTRUCT* create_struct) { |
} |
void WinWindow::OnDestroy() { |
+ if (destroyed_) |
Ben Goodger (Google)
2015/05/13 20:21:07
Instead we should make ~WinWindow not call Destroy
jam
2015/05/14 14:42:48
Done.
|
+ return; |
+ |
+ destroyed_ = true; |
+ |
// TODO(vadimt): Remove ScopedTracker below once crbug.com/440919 is fixed. |
tracked_objects::ScopedTracker tracking_profile( |
FROM_HERE_WITH_EXPLICIT_FUNCTION("440919 WinWindow::OnDestroy")); |