[Gnucash-changes] r13829 - gnucash/trunk - Fix a null pointer dereference. Don't make the Close button sensitive

David Hampton hampton at cvs.gnucash.org
Sat Apr 22 01:09:18 EDT 2006


Author: hampton
Date: 2006-04-22 01:09:17 -0400 (Sat, 22 Apr 2006)
New Revision: 13829
Trac: http://svn.gnucash.org/trac/changeset/13829

Modified:
   gnucash/trunk/ChangeLog
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
Fix a null pointer dereference.  Don't make the Close button sensitive
until a page has been added. Fixes #339372.


Modified: gnucash/trunk/ChangeLog
===================================================================
--- gnucash/trunk/ChangeLog	2006-04-22 04:53:16 UTC (rev 13828)
+++ gnucash/trunk/ChangeLog	2006-04-22 05:09:17 UTC (rev 13829)
@@ -1,5 +1,9 @@
 2006-04-22  David Hampton  <hampton at employees.org>
 
+	* src/gnome-utils/gnc-main-window.c: Fix a null pointer
+	dereference.  Don't make the Close button sensitive until a page
+	has been added. Fixes #339372.
+
 	* src/pixmaps/Makefile.am:
 	* src/gnome-utils/gnc-icons.c: Rename some icon files.
 

Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-04-22 04:53:16 UTC (rev 13828)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2006-04-22 05:09:17 UTC (rev 13829)
@@ -360,6 +360,15 @@
 };
 
 
+/** The following items in the main window should be made insensitive
+ *  at startup time.  The sensitivity will be changed by some later
+ *  event. */
+static const gchar *initially_insensitive_actions[] = {
+	"FileCloseAction",
+	NULL
+};
+
+
 /** The following are in the main window so they will always be
  *  present in the menu structure, but they are always hidden.
  *  These actions should be overridden in child windows where they
@@ -2099,8 +2108,8 @@
 	GncMainWindow *window;
 	GncMainWindowPrivate *priv;
 
-	if (!page->notebook_page)
-		return;
+	if (!page || !page->notebook_page)
+	  return;
 
 	if (!gnc_plugin_page_finish_pending(page))
 	  return;
@@ -2629,6 +2638,9 @@
 					    G_CALLBACK(gnc_main_window_cmd_window_raise),
 					    window);
 	gnc_plugin_update_actions(priv->action_group,
+				  initially_insensitive_actions,
+				  "sensitive", FALSE);
+	gnc_plugin_update_actions(priv->action_group,
 				  always_insensitive_actions,
 				  "sensitive", FALSE);
 	gnc_plugin_update_actions(priv->action_group,



More information about the gnucash-changes mailing list