aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-table-adapter.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2009-05-04 12:10:18 +0800
committerBharath Acharya <abharath@novell.com>2009-05-04 12:10:18 +0800
commitfad86a267fd3c0ebc402ca67f14a0d2f74f57b74 (patch)
tree1920fde1a6ff82bcbcedffb85de9190dd3700b12 /widgets/table/e-tree-table-adapter.c
parent9aec0b31e5d2cd95b53e762dddf38a9982dd6217 (diff)
downloadgsoc2013-evolution-fad86a267fd3c0ebc402ca67f14a0d2f74f57b74.tar.gz
gsoc2013-evolution-fad86a267fd3c0ebc402ca67f14a0d2f74f57b74.tar.zst
gsoc2013-evolution-fad86a267fd3c0ebc402ca67f14a0d2f74f57b74.zip
** BUGFIX: 569696 – Memory leak in message-list
Not exactly a leak, but a build-up over a period of time. Clear the internal gnode on regen.
Diffstat (limited to 'widgets/table/e-tree-table-adapter.c')
-rw-r--r--widgets/table/e-tree-table-adapter.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index 7e63a64783..10c29fbf10 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -72,6 +72,7 @@ struct ETreeTableAdapterPriv {
int pre_change_id;
int no_change_id;
+ int rebuilt_id;
int node_changed_id;
int node_data_changed_id;
int node_col_changed_id;
@@ -543,6 +544,8 @@ etta_dispose (GObject *object)
g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
etta->priv->no_change_id);
g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
+ etta->priv->rebuilt_id);
+ g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
etta->priv->node_changed_id);
g_signal_handler_disconnect (G_OBJECT (etta->priv->source),
etta->priv->node_data_changed_id);
@@ -730,6 +733,7 @@ etta_init (ETreeTableAdapter *etta)
etta->priv->pre_change_id = 0;
etta->priv->no_change_id = 0;
+ etta->priv->rebuilt_id = 0;
etta->priv->node_changed_id = 0;
etta->priv->node_data_changed_id = 0;
etta->priv->node_col_changed_id = 0;
@@ -754,6 +758,27 @@ etta_proxy_no_change (ETreeModel *etm, ETreeTableAdapter *etta)
}
static gboolean
+remove_all (gpointer key, gpointer value, gpointer data)
+{
+ GNode *gn = (GNode *) data;
+ if (data)
+ g_free (gn->data);
+
+ return TRUE;
+}
+
+static void
+etta_proxy_rebuilt (ETreeModel *etm, ETreeTableAdapter *etta)
+{
+ if (!etta->priv->root)
+ return;
+ kill_gnode (etta->priv->root, etta);
+ etta->priv->root = NULL;
+ g_hash_table_destroy (etta->priv->nodes);
+ etta->priv->nodes = g_hash_table_new(NULL, NULL);
+}
+
+static gboolean
resort_model (ETreeTableAdapter *etta)
{
etta_sort_info_changed (NULL, etta);
@@ -866,6 +891,8 @@ e_tree_table_adapter_construct (ETreeTableAdapter *etta, ETreeModel *source, ETa
G_CALLBACK (etta_proxy_pre_change), etta);
etta->priv->no_change_id = g_signal_connect (G_OBJECT (source), "no_change",
G_CALLBACK (etta_proxy_no_change), etta);
+ etta->priv->rebuilt_id = g_signal_connect (G_OBJECT (source), "rebuilt",
+ G_CALLBACK (etta_proxy_rebuilt), etta);
etta->priv->node_changed_id = g_signal_connect (G_OBJECT (source), "node_changed",
G_CALLBACK (etta_proxy_node_changed), etta);
etta->priv->node_data_changed_id = g_signal_connect (G_OBJECT (source), "node_data_changed",