summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTassilo Horn <tassilo@member.fsf.org>2011-11-18 10:36:59 +0100
committerTassilo Horn <tassilo@member.fsf.org>2011-11-18 10:36:59 +0100
commita2addb04643c0631c1c3a79116b5e54f9f302afc (patch)
tree4bd34a91c2baf2ddc04d4b631ce186ee4119bc8c
parent3ed8598c49cbbe3aa3a3605a28d9b7f2df3caf1e (diff)
downloademacs-a2addb04643c0631c1c3a79116b5e54f9f302afc.tar.gz
Work around GTK bug crashing emacs GTK builds.
* frame.c (delete_frame): Don't delete the terminal when the last X frame is closed if emacs is built with GTK toolkit.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/frame.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e1854d7ffcd..81f7fbbdc29 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
+
+ * frame.c (delete_frame): Don't delete the terminal when the last
+ X frame is closed if emacs is built with GTK toolkit.
+
2011-11-17 Juanma Barranquero <lekktu@gmail.com>
* window.c (syms_of_window) <window-combination-resize>: Fix typo.
diff --git a/src/frame.c b/src/frame.c
index c14f4db91da..984651ae9ce 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1359,6 +1359,13 @@ delete_frame (Lisp_Object frame, Lisp_Object force)
/* If needed, delete the terminal that this frame was on.
(This must be done after the frame is killed.) */
terminal->reference_count--;
+#ifdef USE_GTK
+ /* FIXME: Deleting the terminal crashes emacs because of a GTK
+ bug.
+ http://lists.gnu.org/archive/html/emacs-devel/2011-10/msg00363.html */
+ if (terminal->reference_count == 0 && terminal->type == output_x_window)
+ terminal->reference_count = 1;
+#endif /* USE_GTK */
if (terminal->reference_count == 0)
{
Lisp_Object tmp;