Index: ash/desktop_background/desktop_background_controller.cc |
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc |
index 917e0abe795fad5b810ff74aed4ad66844ab424d..f83d9b469ade93a3a26614d69d37869edd4ee516 100644 |
--- a/ash/desktop_background/desktop_background_controller.cc |
+++ b/ash/desktop_background/desktop_background_controller.cc |
@@ -239,10 +239,14 @@ void DesktopBackgroundController::MoveDesktopToUnlockedContainer() { |
} |
void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) { |
- window->SetProperty(internal::kWindowDesktopComponent, |
- static_cast<internal::DesktopBackgroundWidgetController*>(NULL)); |
- window->SetProperty(internal::kComponentWrapper, |
- static_cast<internal::ComponentWrapper*>(NULL)); |
+ if (window->GetProperty(internal::kComponentWrapper) && |
sky
2012/08/15 15:05:11
Why the double check here? Shouldn't you only need
bshe
2012/08/15 15:12:42
Some of the tests destroying window without even c
|
+ (window->GetProperty(internal::kWindowDesktopComponent) != |
+ window->GetProperty(internal::kComponentWrapper)->component())) |
+ delete window->GetProperty(internal::kComponentWrapper)->component(); |
+ window->SetProperty(internal::kWindowDesktopComponent, |
+ static_cast<internal::DesktopBackgroundWidgetController*>(NULL)); |
+ window->SetProperty(internal::kComponentWrapper, |
+ static_cast<internal::ComponentWrapper*>(NULL)); |
} |
void DesktopBackgroundController::SetDesktopBackgroundImageMode() { |