Glynn Clements wrote:
Unfortunately the debugging hit a bit of dead end when it got into
libXm (no debug info there).
OK. Rebuilt Motif with debug info. This indicates that
_XmImFreeShellData is trying to free the the IM data associated with
the EmacsFrame, but this has already been destroyed.
Comparing input-method-{xlib,motif}.c, I see that the xlib version
installs a destroyCallback handler (XIM_delete_frame) which calls
XDestroyIC(). OTOH, the Motif version doesn't; in fact, grepping for
XmImUnregister turns up nothing.
Applying the attached patch results in an xemacs which survives
preliminary testing (ten repeats of "C-x 5 2 C-x 5 0"; the unpatched
version dies on the first attempt).
--
Glynn Clements <glynn(a)sensei.co.uk>
Index: src/input-method-motif.c
===================================================================
RCS file: /usr/CVSroot/XEmacs/xemacs/src/input-method-motif.c,v
retrieving revision 1.9.2.3
diff -u -r1.9.2.3 input-method-motif.c
--- src/input-method-motif.c 2000/01/26 12:34:03 1.9.2.3
+++ src/input-method-motif.c 2001/03/29 23:08:54
@@ -94,6 +94,13 @@
/* Nothing to do */
}
+/* Callback for the deleting frame. */
+static void
+XIM_delete_frame (Widget w, XtPointer client_data, XtPointer call_data)
+{
+ XmImUnregister ((Widget) client_data);
+}
+
void
XIM_init_frame (struct frame *f)
{
@@ -152,6 +159,8 @@
NULL);
XmFontListEntryFree (&fontlistEntry);
+
+ XtAddCallback (w, XmNdestroyCallback, XIM_delete_frame, (XtPointer) w);
}
void