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

Unified Diff: mojo/services/public/cpp/view_manager/lib/view.cc

Issue 311423003: Provide an API to the example window manager app that supports closing a window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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: mojo/services/public/cpp/view_manager/lib/view.cc
diff --git a/mojo/services/public/cpp/view_manager/lib/view.cc b/mojo/services/public/cpp/view_manager/lib/view.cc
index be4397ba4740ff77534db358048c213143dfcada..0e2738f22dc06c2f7f910e9289208468bbe0a0a9 100644
--- a/mojo/services/public/cpp/view_manager/lib/view.cc
+++ b/mojo/services/public/cpp/view_manager/lib/view.cc
@@ -79,9 +79,13 @@ View::View()
manager_(NULL) {}
View::~View() {
- ScopedDestructionNotifier notifier(this);
- if (manager_)
- ViewManagerPrivate(manager_).RemoveView(id_);
+ {
+ // TODO(beng): I'm not sure I like these scoped destruction notifiers.
+ // When they fall out of scope |this| is toast.
+ ScopedDestructionNotifier notifier(this);
+ if (manager_)
+ ViewManagerPrivate(manager_).RemoveView(id_);
+ }
}
void View::LocalDestroy() {

Powered by Google App Engine
This is Rietveld 408576698