diff options
author | Giovanni Campagna <gcampagna@src.gnome.org> | 2012-08-26 01:25:28 +0200 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2012-09-04 21:12:33 -0400 |
commit | 09c1058f3574990f676b8cbf3bc8d719d759b6a3 (patch) | |
tree | 80bde9e81b7fab3b1650109f1bb5bc36a8756532 | |
parent | 6d3d3320d7340b09a310e0aec55cb3abf5dfe2f9 (diff) | |
download | gdm-09c1058f3574990f676b8cbf3bc8d719d759b6a3.tar.gz |
GdmServer: take a reference to self in child watch function
The handlers for the "died" and "exited" signals on gdm server
trigger finalization of the slave by calling gdm_slave_stop().
This commit ensures these handlers hold a reference to the server
object, so the server doesn't get prematurely finalized before
the handler finishes.
https://bugzilla.gnome.org/show_bug.cgi?id=682571
-rw-r--r-- | daemon/gdm-server.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c index e1e9c39e..4cc5264c 100644 --- a/daemon/gdm-server.c +++ b/daemon/gdm-server.c @@ -677,6 +677,8 @@ server_child_watch (GPid pid, : WIFSIGNALED (status) ? WTERMSIG (status) : -1); + g_object_ref (server); + if (WIFEXITED (status)) { int code = WEXITSTATUS (status); g_signal_emit (server, signals [EXITED], 0, code); @@ -687,6 +689,8 @@ server_child_watch (GPid pid, g_spawn_close_pid (server->priv->pid); server->priv->pid = -1; + + g_object_unref (server); } static gboolean |