1
0
Fork 0

backends/remote-access-controller: Own and free the session managers

We were leaking the session managers list, but at this point I feel it
looks cleaner to also own it fully

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3788>
(cherry picked from commit f74a46d98d)
This commit is contained in:
Marco Trevisan (Treviño) 2024-05-29 20:40:55 +02:00 committed by Jonas Ådahl
parent e975e2c4c9
commit 63ff9588a4

View file

@ -194,7 +194,7 @@ meta_remote_access_controller_add (MetaRemoteAccessController *controller,
MetaDbusSessionManager *session_manager)
{
controller->session_managers = g_list_append (controller->session_managers,
session_manager);
g_object_ref (session_manager));
}
static void
@ -274,9 +274,23 @@ meta_remote_access_controller_init (MetaRemoteAccessController *controller)
{
}
static void
meta_remote_access_handle_finalize (GObject *object)
{
MetaRemoteAccessController *controller = META_REMOTE_ACCESS_CONTROLLER (object);
g_clear_list (&controller->session_managers, g_object_unref);
G_OBJECT_CLASS (meta_remote_access_controller_parent_class)->finalize (object);
}
static void
meta_remote_access_controller_class_init (MetaRemoteAccessControllerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_remote_access_handle_finalize;
controller_signals[CONTROLLER_NEW_HANDLE] =
g_signal_new ("new-handle",
G_TYPE_FROM_CLASS (klass),