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

Unified Diff: components/mus/ws/platform_display.cc

Issue 1827453002: Handful of changes to get mus to shutdown correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « components/mus/mus_app.cc ('k') | components/mus/ws/server_window_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/platform_display.cc
diff --git a/components/mus/ws/platform_display.cc b/components/mus/ws/platform_display.cc
index 4e7536e9a30619e3c866742e2fb6d69f9eacfe2c..08619e1bcf3d9afe44281965dd1a6c30db4764b7 100644
--- a/components/mus/ws/platform_display.cc
+++ b/components/mus/ws/platform_display.cc
@@ -200,7 +200,9 @@ void DefaultPlatformDisplay::Init(PlatformDisplayDelegate* delegate) {
}
DefaultPlatformDisplay::~DefaultPlatformDisplay() {
- delegate_->OnTopLevelSurfaceChanged(cc::SurfaceId());
+ // Don't notify the delegate from the destructor.
+ delegate_ = nullptr;
+
// Invalidate WeakPtrs now to avoid callbacks back into the
// DefaultPlatformDisplay during destruction of |top_level_display_client_|.
weak_factory_.InvalidateWeakPtrs();
@@ -399,7 +401,8 @@ void DefaultPlatformDisplay::OnCloseRequest() {
}
void DefaultPlatformDisplay::OnClosed() {
- delegate_->OnDisplayClosed();
+ if (delegate_)
+ delegate_->OnDisplayClosed();
}
void DefaultPlatformDisplay::OnWindowStateChanged(
« no previous file with comments | « components/mus/mus_app.cc ('k') | components/mus/ws/server_window_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698