From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.devel Subject: Re: Killing a frame sometimes kills emacs Date: Thu, 17 Nov 2011 14:45:03 +0100 Message-ID: <871ut6kgm8.fsf@tsdh.uni-koblenz.de> References: <87d3flnxoo.fsf@thinkpad.tsdh.de> <83fwkhdld0.fsf@gnu.org> <871uw04lr9.fsf@thinkpad.tsdh.de> <87sjog35jj.fsf@thinkpad.tsdh.de> <4E5F7ECD.9060601@swipnet.se> <838vq8e0x5.fsf@gnu.org> <87sjn03tzx.fsf@thinkpad.tsdh.de> <87sjmzbmvv.fsf@thinkpad.tsdh.de> <87vcrvm0dr.fsf@stupidchicken.com> <87aa96ogb3.fsf@thinkpad.tsdh.de> <8762ijjbzu.fsf@tsdh.uni-koblenz.de> <878vnfngjk.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1321537537 29220 80.91.229.12 (17 Nov 2011 13:45:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 Nov 2011 13:45:37 +0000 (UTC) Cc: Ulrich Mueller , emacs-devel@gnu.org, schwab@linux-m68k.org, Stefan Monnier , James Cloos , Eli Zaretskii , "Jan D." To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Nov 17 14:45:29 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RR2HP-0007gX-2D for ged-emacs-devel@m.gmane.org; Thu, 17 Nov 2011 14:45:27 +0100 Original-Received: from localhost ([::1]:35798 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RR2HO-0007CG-9B for ged-emacs-devel@m.gmane.org; Thu, 17 Nov 2011 08:45:26 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:60879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RR2HG-0007Bp-Sh for emacs-devel@gnu.org; Thu, 17 Nov 2011 08:45:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RR2HC-0002Rm-Rt for emacs-devel@gnu.org; Thu, 17 Nov 2011 08:45:18 -0500 Original-Received: from deliver.uni-koblenz.de ([141.26.64.15]:34852) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RR2H5-0002OH-3u; Thu, 17 Nov 2011 08:45:07 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id C06FDD2315; Thu, 17 Nov 2011 14:45:05 +0100 (CET) X-Virus-Scanned: amavisd-new at uni-koblenz.de Original-Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y2l4JRwHBymN; Thu, 17 Nov 2011 14:45:05 +0100 (CET) X-CHKRCPT: Envelopesender noch tassilo@member.fsf.org Original-Received: from tsdh.uni-koblenz.de (tsdh.uni-koblenz.de [141.26.67.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTPSA id C5FF3D2303; Thu, 17 Nov 2011 14:45:04 +0100 (CET) In-Reply-To: <878vnfngjk.fsf@gnu.org> (Chong Yidong's message of "Thu, 17 Nov 2011 19:18:23 +0800") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 141.26.64.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146077 Archived-At: Chong Yidong writes: >> I did that by using the patch below for about one month. Since then, >> the crashes I had are gone, and working with multiple emacs X frames >> is fun again. Should I go ahead and commit? > > Fine by me, but the code should probably be something like > > #ifdef USE_GTK > /* ... (Use C-style not C++ style comments) ... */ > if (terminal->type != output_x_window) > #endif > terminal->reference_count--; So the one below is fine, right? What about the indentation of the line after the #endif? Emacs' wants it to be correct in the USE_GTK case, while you have it correct in the other case. --8<---------------cut here---------------start------------->8--- === modified file 'src/frame.c' --- src/frame.c 2011-11-17 09:09:20 +0000 +++ src/frame.c 2011-11-17 13:40:27 +0000 @@ -1358,7 +1358,14 @@ /* 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. See the thread starting with + <87d3flnxoo.fsf@thinkpad.tsdh.de> on emacs-devel. */ + if (terminal->type != output_x_window) +#endif /* USE_GTK */ + terminal->reference_count--; if (terminal->reference_count == 0) { Lisp_Object tmp; --8<---------------cut here---------------end--------------->8--- Bye, Tassilo -- (What the world needs (I think) is not (a Lisp (with fewer parentheses)) but (an English (with more.))) Brian Hayes, http://tinyurl.com/3y9l2kf