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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc

Issue 134103006: linux_aura: Fix cursor memeory leak, which was redding the lsan bot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « ui/views/widget/desktop_aura/desktop_native_widget_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
index 37da13a326cb77550cf604e03d19f9f90330be26..12499aa94f4dc29e3d8bf5e4770181b245b8ffa3 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -212,7 +212,8 @@ class FocusManagerEventHandler : public ui::EventHandler {
DesktopNativeCursorManager* DesktopNativeWidgetAura::native_cursor_manager_ =
tdanderson 2014/01/14 17:42:27 |native_cursor_manager_| is OK to leave as a raw p
NULL;
-views::corewm::CursorManager* DesktopNativeWidgetAura::cursor_manager_ = NULL;
+base::LazyInstance<scoped_ptr<views::corewm::CursorManager> >
+ DesktopNativeWidgetAura::cursor_manager_ = LAZY_INSTANCE_INITIALIZER;
DesktopNativeWidgetAura::DesktopNativeWidgetAura(
internal::NativeWidgetDelegate* delegate)
@@ -401,12 +402,13 @@ void DesktopNativeWidgetAura::InitNativeWidget(
native_cursor_manager_ = new DesktopNativeCursorManager(
DesktopCursorLoaderUpdater::Create());
}
- if (!cursor_manager_) {
- cursor_manager_ = new views::corewm::CursorManager(
- scoped_ptr<corewm::NativeCursorManager>(native_cursor_manager_));
+ if (!cursor_manager_.Get()) {
+ cursor_manager_.Get().reset(new views::corewm::CursorManager(
+ scoped_ptr<corewm::NativeCursorManager>(native_cursor_manager_)));
}
native_cursor_manager_->AddRootWindow(root_window_.get());
- aura::client::SetCursorClient(root_window_->window(), cursor_manager_);
+ aura::client::SetCursorClient(root_window_->window(),
+ cursor_manager_.Get().get());
desktop_root_window_host_->OnRootWindowCreated(root_window_.get(), params);
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_native_widget_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698