changeset 32587:5a809d851acc

Cleanup things in a slightly less (non-fatal) error-producing way.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Tue, 28 Jul 2009 01:52:46 +0000
parents 3abf90b398fc
children c8e05a81428f
files pidgin/gtkblist.c
diffstat 1 files changed, 15 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Tue Jul 28 01:50:42 2009 +0000
+++ b/pidgin/gtkblist.c	Tue Jul 28 01:52:46 2009 +0000
@@ -8204,9 +8204,11 @@
 		return;
 
 	/* Clear the old menu */
-	gtk_ui_manager_remove_ui(gtkblist->ui, accounts_merge_id);
-	gtk_ui_manager_remove_action_group(gtkblist->ui, accounts_action_group);
-	g_object_unref(G_OBJECT(accounts_action_group));
+	if (accounts_action_group) {
+		gtk_ui_manager_remove_ui(gtkblist->ui, accounts_merge_id);
+		gtk_ui_manager_remove_action_group(gtkblist->ui, accounts_action_group);
+		g_object_unref(G_OBJECT(accounts_action_group));
+	}
 
 	accounts_action_group = gtk_action_group_new("Accounts");
 #ifdef ENABLE_NLS
@@ -8449,9 +8451,11 @@
 		return;
 
 	/* Clear the old menu */
-	gtk_ui_manager_remove_ui(gtkblist->ui, plugins_merge_id);
-	gtk_ui_manager_remove_action_group(gtkblist->ui, plugins_action_group);
-	g_object_unref(G_OBJECT(plugins_action_group));
+	if (plugins_action_group) {
+		gtk_ui_manager_remove_ui(gtkblist->ui, plugins_merge_id);
+		gtk_ui_manager_remove_action_group(gtkblist->ui, plugins_action_group);
+		g_object_unref(G_OBJECT(plugins_action_group));
+	}
 
 	plugins_action_group = gtk_action_group_new("Accounts");
 #ifdef ENABLE_NLS
@@ -8585,8 +8589,11 @@
 		return;
 
 	/* Clear the old menu */
-	gtk_ui_manager_remove_ui(gtkblist->ui, sort_merge_id);
-	gtk_ui_manager_remove_action_group(gtkblist->ui, sort_action_group);
+	if (sort_action_group) {
+		gtk_ui_manager_remove_ui(gtkblist->ui, sort_merge_id);
+		gtk_ui_manager_remove_action_group(gtkblist->ui, sort_action_group);
+		g_object_unref(G_OBJECT(sort_action_group));
+	}
 
 	sort_action_group = gtk_action_group_new("SortMethods");
 #ifdef ENABLE_NLS