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

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: 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
« no previous file with comments | « no previous file | ash/root_window_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698