[glade3/glade-3-8] * gladeui/glade-project.c: Fixed crasher when adjusting project naming policy (bug 622528, thank
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3/glade-3-8] * gladeui/glade-project.c: Fixed crasher when adjusting project naming policy (bug 622528, thank
- Date: Fri, 17 Dec 2010 09:47:02 +0000 (UTC)
commit 08e54efcdce8a4e0a32a634e0b1a73e321cf5f0c
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Fri Dec 17 18:52:50 2010 +0900
* gladeui/glade-project.c: Fixed crasher when adjusting project naming policy (bug 622528,
thanks goes to Sébastien Granjoux and Martin Schlemmer for looking at this one).
ChangeLog | 3 +++
gladeui/glade-project.c | 25 ++++++++++++++-----------
2 files changed, 17 insertions(+), 11 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 2ab22e3..3ab0a69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,9 @@
* plugins/gtk+/glade-gtk.c: Fixed crashes when textview's buffer is deleted, fix
by Martin Schlemmer, bug 609748.
+ * gladeui/glade-project.c: Fixed crasher when adjusting project naming policy (bug 622528,
+ thanks goes to Sébastien Granjoux and Martin Schlemmer for looking at this one).
+
2010-12-16 Tristan Van Berkom <tristanvb openismus com>
* plugins/gtk+/glade-gtk.c: Avoid using gtk_combo_box_set_entry_text_column directly (build
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 56ca273..d5c753e 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -3052,28 +3052,31 @@ adjust_naming_policy (GladeProject *project,
GList *list, *objects;
GladeWidget *widget;
- objects = project->priv->tree;
-
- /* Remove all toplevels (recursive operation) */
- for (list = objects; list; list = list->next)
+ /* Ref *all* objects */
+ for (list = project->priv->objects; list; list = list->next)
{
widget = glade_widget_get_from_gobject (list->data);
- g_object_ref (widget->object);
g_object_ref (widget);
- glade_project_remove_object (project, widget->object);
}
+ /* Remove all toplevels (recursive operation) */
+ objects = g_list_copy (project->priv->tree);
+ for (list = objects; list; list = list->next)
+ glade_project_remove_object (project, G_OBJECT (list->data));
+
project->priv->naming_policy = policy;
/* Put the toplevels back with the new policy (recursive operation) */
for (list = objects; list; list = list->next)
+ glade_project_add_object (project, project, G_OBJECT (list->data));
+ g_list_free (objects);
+
+ /* Unref them now */
+ for (list = project->priv->objects; list; list = list->next)
{
- glade_project_add_object (project, project, widget->object);
- g_object_unref (widget->object);
- g_object_unref (widget);
+ widget = glade_widget_get_from_gobject (list->data);
+ g_object_ref (widget);
}
-
- g_list_free (objects);
}
/*******************************************************************
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]