[glade3/glade-3-8] * gladeui/glade-project.c: Fix glade_project_fix_object_props() to copy the list which risks cha



commit 22e8957174b78e0fb0bc91e0232de2917748d930
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Thu Dec 16 02:04:06 2010 +0900

    	* gladeui/glade-project.c: Fix glade_project_fix_object_props() to copy the
    	  list which risks changing order while iterating.

 ChangeLog               |    3 +++
 gladeui/glade-project.c |    6 ++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b68befc..cd0707d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,9 @@
 	* gladeui/glade-utils.c: Fixed crasher bug 628233 partially using patch by
 	  ramz <ramanathan nitt gmail com>.
 
+	* gladeui/glade-project.c: Fix glade_project_fix_object_props() to copy the
+	  list which risks changing order while iterating.
+
 2010-12-14  Tristan Van Berkom <tristanvb openismus com>
 
 	* Reverted 3.0 commit, now targetting this branch to the final GTK+ 2.x chapter
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index 28ade78..1604f07 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -963,13 +963,14 @@ glade_project_new (void)
 static void 
 glade_project_fix_object_props (GladeProject *project)
 {
-	GList         *l, *ll;
+	GList         *l, *ll, *objects;
 	GValue        *value;
 	GladeWidget   *gwidget;
 	GladeProperty *property;
 	gchar         *txt;
 
-	for (l = project->priv->objects; l; l = l->next)
+	objects = g_list_copy (project->priv->objects);
+	for (l = objects; l; l = l->next)
 	{
 		gwidget = glade_widget_get_from_gobject (l->data);
 
@@ -998,6 +999,7 @@ glade_project_fix_object_props (GladeProject *project)
 			}
 		}
 	}
+	g_list_free (objects);
 }
 
 static gchar *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]