mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
backend: Cleanup cursor tracker on shutdown
It keeps references to cursors, and cursors keep references to DRM buffers. In order to be able to clean up on exit, explicitly destroy the cursor tracker on shutdown. We can't rely on GObject reference counting, as gjs might hold onto a reference until it's garbage collected. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1822>
This commit is contained in:
parent
f1a120ca36
commit
558cb4fac3
@ -199,6 +199,7 @@ meta_backend_dispose (GObject *object)
|
||||
MetaBackend *backend = META_BACKEND (object);
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
|
||||
g_clear_pointer (&priv->cursor_tracker, meta_cursor_tracker_destroy);
|
||||
g_clear_object (&priv->current_device);
|
||||
g_clear_object (&priv->monitor_manager);
|
||||
g_clear_object (&priv->orientation_manager);
|
||||
|
@ -51,4 +51,6 @@ MetaBackend * meta_cursor_tracker_get_backend (MetaCursorTracker *tracker);
|
||||
|
||||
void meta_cursor_tracker_notify_cursor_changed (MetaCursorTracker *tracker);
|
||||
|
||||
void meta_cursor_tracker_destroy (MetaCursorTracker *tracker);
|
||||
|
||||
#endif
|
||||
|
@ -190,6 +190,13 @@ meta_cursor_tracker_real_get_sprite (MetaCursorTracker *tracker)
|
||||
return priv->displayed_cursor;
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_tracker_destroy (MetaCursorTracker *tracker)
|
||||
{
|
||||
g_object_run_dispose (G_OBJECT (tracker));
|
||||
g_object_unref (tracker);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_tracker_init (MetaCursorTracker *tracker)
|
||||
{
|
||||
@ -244,7 +251,7 @@ meta_cursor_tracker_set_property (GObject *object,
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_tracker_finalize (GObject *object)
|
||||
meta_cursor_tracker_dispose (GObject *object)
|
||||
{
|
||||
MetaCursorTracker *tracker = META_CURSOR_TRACKER (object);
|
||||
MetaCursorTrackerPrivate *priv =
|
||||
@ -254,7 +261,7 @@ meta_cursor_tracker_finalize (GObject *object)
|
||||
g_clear_object (&priv->displayed_cursor);
|
||||
g_clear_object (&priv->root_cursor);
|
||||
|
||||
G_OBJECT_CLASS (meta_cursor_tracker_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (meta_cursor_tracker_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -264,7 +271,7 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
|
||||
|
||||
object_class->get_property = meta_cursor_tracker_get_property;
|
||||
object_class->set_property = meta_cursor_tracker_set_property;
|
||||
object_class->finalize = meta_cursor_tracker_finalize;
|
||||
object_class->dispose = meta_cursor_tracker_dispose;
|
||||
|
||||
klass->set_force_track_position =
|
||||
meta_cursor_tracker_real_set_force_track_position;
|
||||
|
Loading…
Reference in New Issue
Block a user