In gnucash 1.2.3 the gnc_ui_shutdown() function of motif/top-level.c
may call XtDestroyWidget() on a NULL pointer causing a segmentation
fault.  The enclosed patch is a proposed fix for that.  I experienced
the problem when I started gnucash 1.2.3 and it got an error loading
~/.gnucash/config.auto before the user interface was up, which led to
a call of _gnc_shutdown_ in guile/gnucash.c which as its last step
calls gnc_ui_shutdown().

diff -u -r1.1.1.3 -r1.2
--- top-level.c 1999/08/23 00:57:31     1.1.1.3
+++ top-level.c 1999/08/23 02:08:19     1.2
@@ -53,7 +53,11 @@
 
 void
 gnc_ui_shutdown() {
-  XtDestroyWidget(gnc_get_ui_data());
+  gncUIWidget ui_data = gnc_get_ui_data();
+
+  /* Only call XtDestroyWidget() if ui_data is non-NULL.  */
+  if (ui_data != NULL)
+    XtDestroyWidget(ui_data);
 }
 
 /* This static indicates the debugging module that this .o belongs to.  */

-- 
Per Bojsen                                        <[EMAIL PROTECTED]>
6132 Lexington Ridge Drive
Lexington, MA 02421-8317
USA

Reply via email to