native: don't leak logind session proxy

It's currently getting leaked in error paths

https://bugzilla.gnome.org/show_bug.cgi?id=745141
This commit is contained in:
Ray Strode 2015-02-24 22:25:34 -05:00
parent 1e8e107dd9
commit cbad65f657

View File

@ -317,14 +317,14 @@ meta_launcher_new (void)
{ {
g_warning ("Could not take control: %s", error->message); g_warning ("Could not take control: %s", error->message);
g_error_free (error); g_error_free (error);
return NULL; goto out;
} }
if (!get_kms_fd (session_proxy, &kms_fd)) if (!get_kms_fd (session_proxy, &kms_fd))
return NULL; goto out;
self = g_slice_new0 (MetaLauncher); self = g_slice_new0 (MetaLauncher);
self->session_proxy = session_proxy; self->session_proxy = g_object_ref (session_proxy);
self->seat_proxy = get_seat_proxy (NULL); self->seat_proxy = get_seat_proxy (NULL);
self->session_active = TRUE; self->session_active = TRUE;
@ -336,6 +336,9 @@ meta_launcher_new (void)
g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self); g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);
out:
g_object_unref (session_proxy);
return self; return self;
} }