[gdm/gnome-3-8] session: harden against server dbus outliving session object
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/gnome-3-8] session: harden against server dbus outliving session object
- Date: Tue, 30 Jul 2013 18:44:54 +0000 (UTC)
commit 6a26f528402b4fc669335f30a9a58141d5d418dd
Author: Ray Strode <rstrode redhat com>
Date: Mon Jul 29 10:17:30 2013 -0400
session: harden against server dbus outliving session object
Right now we do:
g_signal_connect (dbus_server, "...", callback, self);
in a few places. These signal connections should go away when the dbus
server is unreffed in dispose, but to be on the safe side we should
use g_signal_connect_object anyway. (See for instance the leak
fix in the previous commit).
daemon/gdm-session.c | 36 ++++++++++++++++++++----------------
1 files changed, 20 insertions(+), 16 deletions(-)
---
diff --git a/daemon/gdm-session.c b/daemon/gdm-session.c
index 9f79460..311412f 100644
--- a/daemon/gdm-session.c
+++ b/daemon/gdm-session.c
@@ -1553,10 +1553,11 @@ setup_worker_server (GdmSession *self)
g_debug ("GdmSession: Creating D-Bus server for worker for session");
observer = g_dbus_auth_observer_new ();
- g_signal_connect (observer,
- "authorize-authenticated-peer",
- G_CALLBACK (allow_worker_function),
- self);
+ g_signal_connect_object (observer,
+ "authorize-authenticated-peer",
+ G_CALLBACK (allow_worker_function),
+ self,
+ 0);
server = gdm_dbus_setup_private_server (observer, &error);
g_object_unref (observer);
@@ -1567,10 +1568,11 @@ setup_worker_server (GdmSession *self)
return;
}
- g_signal_connect (server,
- "new-connection",
- G_CALLBACK (handle_connection_from_worker),
- self);
+ g_signal_connect_object (server,
+ "new-connection",
+ G_CALLBACK (handle_connection_from_worker),
+ self,
+ 0);
self->priv->worker_server = server;
g_dbus_server_start (server);
@@ -1607,10 +1609,11 @@ setup_outside_server (GdmSession *self)
g_debug ("GdmSession: Creating D-Bus server for greeters and such");
observer = g_dbus_auth_observer_new ();
- g_signal_connect (observer,
- "authorize-authenticated-peer",
- G_CALLBACK (allow_user_function),
- self);
+ g_signal_connect_object (observer,
+ "authorize-authenticated-peer",
+ G_CALLBACK (allow_user_function),
+ self,
+ 0);
server = gdm_dbus_setup_private_server (observer, &error);
g_object_unref (observer);
@@ -1621,10 +1624,11 @@ setup_outside_server (GdmSession *self)
return;
}
- g_signal_connect (server,
- "new-connection",
- G_CALLBACK (handle_connection_from_outside),
- self);
+ g_signal_connect_object (server,
+ "new-connection",
+ G_CALLBACK (handle_connection_from_outside),
+ self,
+ 0);
self->priv->outside_server = server;
g_dbus_server_start (server);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]