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

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

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: +comment 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
Index: ui/views/widget/desktop_aura/desktop_native_widget_aura.h
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
index 74ef63428d87c2d263f978c1408c178fdfe524f3..2fa86fc60eb06c7519d38fcfb7e771d97b5c77f1 100644
--- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.h
@@ -295,6 +295,13 @@ class VIEWS_EXPORT DesktopNativeWidgetAura
bool restore_focus_on_activate_;
gfx::NativeCursor cursor_;
+ // We must manually reference count the number of users of |cursor_manager_|
+ // because the cursors created by |cursor_manager_| are shared among the
+ // DNWAs. We can't just stuff this in a LazyInstance because we need to
+ // destroy this as the last DNWA happens; we can't put it off until
+ // (potentially) after we tear down the X11 connection because that's a
+ // crash.
+ static int cursor_reference_count_;
static views::corewm::CursorManager* cursor_manager_;
static views::DesktopNativeCursorManager* native_cursor_manager_;

Powered by Google App Engine
This is Rietveld 408576698