| 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();
|
| }
|
|
|