aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/ChangeLog11
-rw-r--r--widgets/table/e-tree-table-adapter.c13
2 files changed, 23 insertions, 1 deletions
diff --git a/widgets/table/ChangeLog b/widgets/table/ChangeLog
index 2dedd14e7e..ab9bd4ea90 100644
--- a/widgets/table/ChangeLog
+++ b/widgets/table/ChangeLog
@@ -1,3 +1,14 @@
+2007-08-24 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #239441
+
+ * e-tree-table-adapter.c: (struct ETreeTableAdapterPriv),
+ (etta_finalize), (etta_init), (resort_model),
+ (etta_proxy_node_changed):
+ Remember resort_idle_id and remove it from g_source when
+ finalizing structure, so it will not be called when the
+ structure itself is already freed.
+
2007-08-23 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #303877.
diff --git a/widgets/table/e-tree-table-adapter.c b/widgets/table/e-tree-table-adapter.c
index 255dbed5fe..0cd84650e5 100644
--- a/widgets/table/e-tree-table-adapter.c
+++ b/widgets/table/e-tree-table-adapter.c
@@ -80,6 +80,8 @@ struct ETreeTableAdapterPriv {
int node_removed_id;
int node_request_collapse_id;
int sort_info_changed_id;
+
+ guint resort_idle_id;
};
static void etta_sort_info_changed (ETableSortInfo *sort_info, ETreeTableAdapter *etta);
@@ -498,6 +500,11 @@ etta_finalize (GObject *object)
{
ETreeTableAdapter *etta = E_TREE_TABLE_ADAPTER (object);
+ if (etta->priv->resort_idle_id) {
+ g_source_remove (etta->priv->resort_idle_id);
+ etta->priv->resort_idle_id = 0;
+ }
+
if (etta->priv->root) {
kill_gnode(etta->priv->root, etta);
etta->priv->root = NULL;
@@ -728,6 +735,8 @@ etta_init (ETreeTableAdapter *etta)
etta->priv->node_inserted_id = 0;
etta->priv->node_removed_id = 0;
etta->priv->node_request_collapse_id = 0;
+
+ etta->priv->resort_idle_id = 0;
}
static void
@@ -746,6 +755,7 @@ static gboolean
resort_model (ETreeTableAdapter *etta)
{
etta_sort_info_changed (NULL, etta);
+ etta->priv->resort_idle_id = 0;
return FALSE;
}
@@ -758,7 +768,8 @@ etta_proxy_node_changed (ETreeModel *etm, ETreePath path, ETreeTableAdapter *ett
/* FIXME: Really it shouldnt be required. But a lot of thread
* which were supposed to be present in the list is way below
*/
- g_idle_add ((GSourceFunc) resort_model, etta);
+ if (!etta->priv->resort_idle_id)
+ etta->priv->resort_idle_id = g_idle_add ((GSourceFunc) resort_model, etta);
}
static void