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

Unified Diff: ash/desktop_background/desktop_background_widget_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_widget_controller.cc
diff --git a/ash/desktop_background/desktop_background_widget_controller.cc b/ash/desktop_background/desktop_background_widget_controller.cc
index 1d0f5fa9066c1ff5100c17e0e5018a565b32e584..5d2bf71038f005176a0b13cb4f07ff806eb6658b 100644
--- a/ash/desktop_background/desktop_background_widget_controller.cc
+++ b/ash/desktop_background/desktop_background_widget_controller.cc
@@ -55,7 +55,15 @@ void DesktopBackgroundWidgetController::Reparent(aura::RootWindow* root_window,
}
ComponentWrapper::ComponentWrapper(
- DesktopBackgroundWidgetController* component) : component_(component) {
+ DesktopBackgroundWidgetController* component) {
+ component_.reset(component);
+}
+
+DesktopBackgroundWidgetController* ComponentWrapper::GetComponent(
+ bool pass_ownership) {
+ if (pass_ownership)
+ return component_.release();
+ return component_.get();
}
} // namespace internal

Powered by Google App Engine
This is Rietveld 408576698