summaryrefslogtreecommitdiffstats
path: root/metacity-2.28-IceCloseConnection.patch
blob: dc996ea2a0023f0c5ad8813c705e0b830c011ca9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 3fd59d1e7e1a23202f58536fb7a995aa5951664b Mon Sep 17 00:00:00 2001
From: Owen W. Taylor <otaylor@fishsoup.net>
Date: Thu, 17 Dec 2009 16:20:18 -0500
Subject: [PATCH] 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
---
 src/core/session.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/core/session.c b/src/core/session.c
index 96d8d71..0a12649 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,7 +107,12 @@ process_ice_messages (GIOChannel *channel,
       IcePointer context = IceGetConnectionContext (connection);
 #endif
       
-      /* We were disconnected */
+      /* 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);
       IceSetShutdownNegotiation (connection, False);
       IceCloseConnection (connection);
 
-- 
1.6.5.2