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

Unified Diff: mojo/examples/window_manager/window_manager.cc

Issue 516523004: Fixes to get view_manager_lib_unittests not crash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/window_manager/window_manager.cc
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc
index 0771cdc442e07f209ae8036a598f0707205b3d1e..9abc98922b1b6527bda6841cdc18e13f644034b9 100644
--- a/mojo/examples/window_manager/window_manager.cc
+++ b/mojo/examples/window_manager/window_manager.cc
@@ -265,7 +265,10 @@ class WindowManager
app_(NULL) {}
virtual ~WindowManager() {
- window_manager_app_->host()->window()->RemovePreTargetHandler(this);
+ // host() may be destroyed by the time we get here.
+ // TODO: figure out a way to always cleanly remove handler.
+ if (window_manager_app_->host())
+ window_manager_app_->host()->window()->RemovePreTargetHandler(this);
}
void CloseWindow(Id view_id) {
« no previous file with comments | « no previous file | mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698