[glade3] * gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little bit of m
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] * gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little bit of m
- Date: Fri, 31 Dec 2010 04:42:25 +0000 (UTC)
commit 827554e4e5821613d9cfeea689dc43797c060f56
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Fri Dec 31 13:29:23 2010 +0900
* gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little
bit of memory for large projects but no crashes.
Conflicts:
ChangeLog
gladeui/glade-project.c
ChangeLog | 5 +++++
gladeui/glade-project.c | 21 ++++++++++++---------
2 files changed, 17 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 0d70f68..ae7f4d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-31 Tristan Van Berkom <tristanvb openismus com>
+
+ * gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little
+ bit of memory for large projects but no crashes.
+
2010-12-30 Christian Persch <chpe gnome org>
* plugins/gtk+/glade-attributes.c: Use locale-independent strtod &
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index d26dd9f..3fe5b63 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -295,16 +295,16 @@ glade_project_dispose (GObject * object)
{
GladeWidget *gwidget = glade_widget_get_from_gobject (list->data);
- g_object_ref (gwidget);
-
- glade_project_remove_object (project, list->data);
-
unparent_objects_recurse (gwidget);
-
- g_object_unref (gwidget);
}
g_list_free (tree);
+ while (project->priv->tree)
+ glade_project_remove_object (project, project->priv->tree->data);
+
+ while (project->priv->objects)
+ glade_project_remove_object (project, project->priv->objects->data);
+
g_assert (project->priv->tree == NULL);
g_assert (project->priv->objects == NULL);
@@ -4483,10 +4483,13 @@ glade_project_model_get_path (GtkTreeModel * model, GtkTreeIter * iter)
/* Get the index for the top-level list */
top = g_list_find (project->priv->tree, glade_widget_get_object (toplevel));
- g_assert (top != NULL);
- gtk_tree_path_prepend_index (path, g_list_position (project->priv->tree,
- top));
+ /* While the project is disposing widgets are unparented and sometimes no longer in the tree */
+ if (top)
+ gtk_tree_path_prepend_index (path, g_list_position (project->priv->tree, top));
+ else
+ gtk_tree_path_prepend_index (path, 0);
+
return path;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]