summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2009-12-17 16:20:18 -0500
committerThomas Thurman <tthurman@gnome.org>2010-01-14 16:43:51 -0500
commitedeadf62ef1f543afc0d75156b399a8e0a1db9e1 (patch)
treec8da907e5a178dbbe507495d2e751cc4e88b5499 /src
parent5ac80057c4d5ef272dec5e7bcea82dc8bb559c08 (diff)
downloadmetacity-edeadf62ef1f543afc0d75156b399a8e0a1db9e1.tar.gz
Don't call IceCloseConnection() behind libSM's back
The ICE connection is opened by libSM; we can't just close it when we get an IOError on the ICE connection; instead call SmcCloseConnection() and mark the connection as closed. This will prevent a segfault if we exit out of the metacity main loop and get to meta_finalize(). https://bugzilla.gnome.org/show_bug.cgi?id=604867
Diffstat (limited to 'src')
-rw-r--r--src/core/session.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/session.c b/src/core/session.c
index 6d2c5fbb..5589cf4e 100644
--- a/src/core/session.c
+++ b/src/core/session.c
@@ -84,6 +84,7 @@ static char* load_state (const char *previous_save_file);
static void regenerate_save_file (void);
static const char* full_save_file (void);
static void warn_about_lame_clients_and_finish_interact (gboolean shutdown);
+static void disconnect (void);
/* This is called when data is available on an ICE connection. */
static gboolean
@@ -106,9 +107,12 @@ process_ice_messages (GIOChannel *channel,
IcePointer context = IceGetConnectionContext (connection);
#endif
- /* We were disconnected */
- IceSetShutdownNegotiation (connection, False);
- IceCloseConnection (connection);
+ /* We were disconnected; close our connection to the
+ * session manager, this will result in the ICE connection
+ * being cleaned up, since it is owned by libSM.
+ */
+ disconnect ();
+ meta_quit (META_EXIT_SUCCESS);
return FALSE;
}