From xemacs-m  Thu Feb  6 00:07:00 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id AAA13359
	for <xemacs-beta@xemacs.org>; Thu, 6 Feb 1997 00:06:59 -0600 (CST)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id WAA09857;
	Wed, 5 Feb 1997 22:18:07 -0800
To: xemacs-beta@xemacs.org
Subject: Re: 20.0: another frame related crash
References: <QQcbqu26368.199702060204@crystal.WonderWorks.COM>
X-Url: http://www.miranova.com/%7Esteve/
Mail-Copies-To: never
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: Kyle Jones's message of Wed, 5 Feb 1997 21:04:22 -0500 (EST)
Mime-Version: 1.0 (generated by tm-edit 7.101)
Content-Type: text/plain; charset=US-ASCII
Date: 05 Feb 1997 22:18:05 -0800
Message-ID: <m2zpxi31b6.fsf@altair.xemacs.org>
Lines: 51
X-Mailer: Gnus v5.4.11/XEmacs 20.0

Kyle Jones writes:

> floating-toolbar killed this one.  mouse-3, boom!

I think I figured out what is going on.  Frames that have popups can
be deleted, but the popup's frame data structure isn't removed even
though all the X11 objects have been killed by the server.  This patch
(I hope) disables deletion of parent frames.  Your test case now stops
with an error message.

Index: frame.c
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/src/frame.c,v
retrieving revision 1.2
diff -u -r1.2 frame.c
--- frame.c	1997/02/02 02:16:27	1.2
+++ frame.c	1997/02/06 06:13:32
@@ -1278,6 +1278,29 @@
 	}
     }
 
+  /* Test for popup frames hanging around. */
+  /* Deletion of a parent frame with popups is deadly. */
+  {
+    Lisp_Object frmcons, devcons, concons;
+
+    FRAME_LOOP_NO_BREAK (frmcons, devcons, concons)
+      {
+	Lisp_Object this = XCAR (frmcons);
+
+
+	if (! EQ (this, frame)
+	    && EQ (frame, DEVMETH_OR_GIVEN(XDEVICE(XCAR(devcons)),
+					   get_frame_parent,
+					   XFRAME(this),
+					   Qnil)))
+	  {
+	    /* We've found a popup frame whose parent is this frame. */
+	    signal_simple_error
+	      ("Attempt to delete a frame with live popups", frame);
+	  }
+      }
+  }
+
   /* Before here, we haven't made any dangerous changes (just checked for
      error conditions).  Now run the delete-frame-hook.  Remember that
      user code there could do any number of dangerous things, including

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

