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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 10854153: Fix memory leak on Chromium OS Heapcheck and Chromium OS (valgrind) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use scoped ptr to manage ownership Created 8 years, 4 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
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..3df47d5922b62deeda4148ac58d31e6b27d4a39b 100644
--- a/ash/desktop_background/desktop_background_controller.cc
+++ b/ash/desktop_background/desktop_background_controller.cc
@@ -239,10 +239,10 @@ 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));
+ window->SetProperty(internal::kWindowDesktopComponent,
+ static_cast<internal::DesktopBackgroundWidgetController*>(NULL));
+ window->SetProperty(internal::kComponentWrapper,
+ static_cast<internal::ComponentWrapper*>(NULL));
}
void DesktopBackgroundController::SetDesktopBackgroundImageMode() {
@@ -319,7 +319,13 @@ void DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
aura::RootWindow* root_window = *iter;
if (root_window->GetProperty(internal::kComponentWrapper)) {
internal::DesktopBackgroundWidgetController* component = root_window->
- GetProperty(internal::kComponentWrapper)->component();
+ GetProperty(internal::kWindowDesktopComponent);
+ // Wallpaper animation may not finish at this point. Try to get component
+ // from kComponentWrapper instead.
+ if (!component) {
+ component = root_window->GetProperty(internal::kComponentWrapper)->
+ GetComponent(false);
+ }
DCHECK(component);
component->Reparent(root_window,
src_container,
« no previous file with comments | « no previous file | ash/desktop_background/desktop_background_view.cc » ('j') | ash/desktop_background/desktop_background_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698