SF.net SVN: geany:[4645] branches/geany-0.18.1

eht16 at users.sourceforge.net eht16 at xxxxx
Sat Feb 6 17:41:20 UTC 2010


Revision: 4645
          http://geany.svn.sourceforge.net/geany/?rev=4645&view=rev
Author:   eht16
Date:     2010-02-06 17:41:19 +0000 (Sat, 06 Feb 2010)

Log Message:
-----------
Unref the new files toolbar menu when setting a new menu to fix possible crashes when reloading configuration.

Modified Paths:
--------------
    branches/geany-0.18.1/ChangeLog
    branches/geany-0.18.1/src/geanymenubuttonaction.c
    branches/geany-0.18.1/src/templates.c

Modified: branches/geany-0.18.1/ChangeLog
===================================================================
--- branches/geany-0.18.1/ChangeLog	2010-02-06 17:25:58 UTC (rev 4644)
+++ branches/geany-0.18.1/ChangeLog	2010-02-06 17:41:19 UTC (rev 4645)
@@ -1,3 +1,10 @@
+2010-02-06  Enrico Tröger  <enrico(dot)troeger(at)uvena(dot)de>
+
+ * src/geanymenubuttonaction.c, src/templates.c:
+   Unref the new files toolbar menu when setting a new menu to fix
+   possible crashes when reloading configuration.
+
+
 2010-02-01  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
 
  * src/plugins.c:

Modified: branches/geany-0.18.1/src/geanymenubuttonaction.c
===================================================================
--- branches/geany-0.18.1/src/geanymenubuttonaction.c	2010-02-06 17:25:58 UTC (rev 4644)
+++ branches/geany-0.18.1/src/geanymenubuttonaction.c	2010-02-06 17:41:19 UTC (rev 4645)
@@ -165,8 +165,11 @@
 
 	priv = GEANY_MENU_BUTTON_ACTION_GET_PRIVATE(action);
 
-	if (priv->menu != NULL)
+	if (priv->menu != NULL && GTK_IS_WIDGET(priv->menu))
+	{
 		g_signal_handlers_disconnect_by_func(priv->menu, menu_items_changed_cb, action);
+		g_object_unref(priv->menu);
+	}
 	if (menu != NULL)
 	{
 		g_signal_connect(menu, "add", G_CALLBACK(menu_items_changed_cb), action);

Modified: branches/geany-0.18.1/src/templates.c
===================================================================
--- branches/geany-0.18.1/src/templates.c	2010-02-06 17:25:58 UTC (rev 4644)
+++ branches/geany-0.18.1/src/templates.c	2010-02-06 17:41:19 UTC (rev 4645)
@@ -797,6 +797,10 @@
 	{
 		gtk_widget_destroy(GTK_WIDGET(item->data));
 	}
+
+	geany_menu_button_action_set_menu(
+		GEANY_MENU_BUTTON_ACTION(toolbar_get_action_by_name("New")), NULL);
+	new_with_template_menu = NULL;
 }
 
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list