[glade3/glade-3-8] * 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/glade-3-8] * gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little bit of m
- Date: Fri, 31 Dec 2010 04:42:05 +0000 (UTC)
commit 81e607ffe98685c843a820799e0b9903e0395321
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Fri Dec 31 13:04:10 2010 +0900
* gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little
bit of memory for large projects but no crashes.
ChangeLog | 3 +++
gladeui/glade-project.c | 21 ++++++++++++---------
2 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 941d65f..e2ac537 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@
* plugins/gtk+/glade-gtk.c, plugins/gtk+/gtk+.xml.in: Added editor to edit
GtkAction/GtkActionGroup hierarchies.
+ * gladeui/glade-project.c: Further fixing project dispose cycle, still leaking a little
+ bit of memory for large projects but no crashes.
+
2010-12-29 Tristan Van Berkom <tristanvb openismus com>
* gladeui/glade-design-view.c: Made loading progress bar nicer looking and ellipsizing.
diff --git a/gladeui/glade-project.c b/gladeui/glade-project.c
index b469d19..4b5e0f0 100644
--- a/gladeui/glade-project.c
+++ b/gladeui/glade-project.c
@@ -310,16 +310,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);
@@ -4806,9 +4806,12 @@ glade_project_model_get_path (GtkTreeModel* model,
/* 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]