Chromium Code Reviews| Index: ui/aura/window.cc |
| diff --git a/ui/aura/window.cc b/ui/aura/window.cc |
| index 69bddfdc77219efb3630e5455df8d1975138c1df..2ced9089a95908525dbd6ecd2f794025e3ce1ec9 100644 |
| --- a/ui/aura/window.cc |
| +++ b/ui/aura/window.cc |
| @@ -202,9 +202,11 @@ Window::Window(WindowDelegate* delegate) |
| } |
| Window::~Window() { |
| - if (layer()->owner() == this) |
| - layer()->CompleteAllAnimations(); |
| - layer()->SuppressPaint(); |
| + if (layer()) { |
|
danakj
2015/06/03 22:02:50
Not having a layer means you made a Window but did
|
| + if (layer()->owner() == this) |
| + layer()->CompleteAllAnimations(); |
| + layer()->SuppressPaint(); |
| + } |
| // Let the delegate know we're in the processing of destroying. |
| if (delegate_) |
| @@ -260,9 +262,11 @@ Window::~Window() { |
| } |
| prop_map_.clear(); |
| - // The layer will either be destroyed by |layer_owner_|'s dtor, or by whoever |
| - // acquired it. |
| - layer()->set_delegate(NULL); |
| + if (layer()) { |
| + // The layer will either be destroyed by |layer_owner_|'s dtor, or by |
| + // whoever acquired it. |
| + layer()->set_delegate(NULL); |
| + } |
| DestroyLayer(); |
| } |