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:
parent
e975e2c4c9
commit
63ff9588a4
1 changed files with 15 additions and 1 deletions
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue