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

Unified Diff: services/ui/view_manager/view_registry.cc

Issue 1759003002: Mozart: Correctly unregister views. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/view_manager/view_registry.cc
diff --git a/services/ui/view_manager/view_registry.cc b/services/ui/view_manager/view_registry.cc
index 410537ef0e69a613a74d14a9e9ea6f5da47f6fbf..4868d0dd285036edeb36833f92e07a683d842cd5 100644
--- a/services/ui/view_manager/view_registry.cc
+++ b/services/ui/view_manager/view_registry.cc
@@ -459,8 +459,9 @@ void ViewRegistry::TransferOrUnregisterViewStub(
void ViewRegistry::UnregisterViewStub(std::unique_ptr<ViewStub> view_stub) {
DCHECK(view_stub);
- if (view_stub->state())
- UnregisterView(view_stub->state());
+ ViewState* view_state = view_stub->ReleaseView();
+ if (view_state)
+ UnregisterView(view_state);
}
void ViewRegistry::SetLayout(ViewStub* view_stub,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698