Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: ui/platform_window/win/win_window.cc

Issue 1139673003: Make Mandoline shut down cleanly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crash in surfaces if surfaceimpl outlives the app, and a double delete in browser Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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"));

Powered by Google App Engine
This is Rietveld 408576698