From a2addb04643c0631c1c3a79116b5e54f9f302afc Mon Sep 17 00:00:00 2001 From: Tassilo Horn Date: Fri, 18 Nov 2011 10:36:59 +0100 Subject: [PATCH] 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. --- src/ChangeLog | 5 +++++ src/frame.c | 7 +++++++ 2 files changed, 12 insertions(+) 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 + + * 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 * window.c (syms_of_window) : 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; -- 2.39.2