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

Unified Diff: ui/gfx/compositor/compositor.cc

Issue 8510076: Fix stale compositor references from ui::Layer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix linux_touch build Created 9 years, 1 month 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 | « ui/gfx/compositor/compositor.h ('k') | ui/gfx/compositor/compositor_cc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/compositor.cc
diff --git a/ui/gfx/compositor/compositor.cc b/ui/gfx/compositor/compositor.cc
index 6e9e1d5e216b3d92af98142906cbcfe7fe3af7a6..485dc2d5c6468ff0ab368a7e944ea79b0a292784 100644
--- a/ui/gfx/compositor/compositor.cc
+++ b/ui/gfx/compositor/compositor.cc
@@ -26,6 +26,8 @@ Compositor::Compositor(CompositorDelegate* delegate, const gfx::Size& size)
}
Compositor::~Compositor() {
+ if (root_layer_)
+ root_layer_->SetCompositor(NULL);
}
void Compositor::ScheduleDraw() {
@@ -33,8 +35,10 @@ void Compositor::ScheduleDraw() {
}
void Compositor::SetRootLayer(Layer* root_layer) {
+ if (root_layer_)
+ root_layer_->SetCompositor(NULL);
root_layer_ = root_layer;
- if (!root_layer_->GetCompositor())
+ if (root_layer_ && !root_layer_->GetCompositor())
root_layer_->SetCompositor(this);
OnRootLayerChanged();
}
« no previous file with comments | « ui/gfx/compositor/compositor.h ('k') | ui/gfx/compositor/compositor_cc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698