aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2003-05-16 02:33:47 +0800
committerMike Kestner <mkestner@src.gnome.org>2003-05-16 02:33:47 +0800
commit6cdf75996f3e0ff5f285440870671e3890e003e8 (patch)
treecee8f4e3f03aa1d7136bab98b6b7978e45802f47 /widgets/table
parentca848e5756dfd0a983f19c6ea6e6a78ad01ed7ee (diff)
downloadgsoc2013-evolution-6cdf75996f3e0ff5f285440870671e3890e003e8.tar
gsoc2013-evolution-6cdf75996f3e0ff5f285440870671e3890e003e8.tar.gz
gsoc2013-evolution-6cdf75996f3e0ff5f285440870671e3890e003e8.tar.bz2
gsoc2013-evolution-6cdf75996f3e0ff5f285440870671e3890e003e8.tar.lz
gsoc2013-evolution-6cdf75996f3e0ff5f285440870671e3890e003e8.tar.xz
gsoc2013-evolution-6cdf75996f3e0ff5f285440870671e3890e003e8.tar.zst
gsoc2013-evolution-6cdf75996f3e0ff5f285440870671e3890e003e8.zip
use weak refs not datasets. (e_tree_dispose): weak_unref the context.
2003-05-14 Mike Kestner <mkestner@ximian.com> * e-tree-c (context_connect): use weak refs not datasets. (e_tree_dispose): weak_unref the context. Hopefully fixes 42617. svn path=/trunk/; revision=21195
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-tree.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index 270e59decf..27c7e9ae1b 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -246,6 +246,7 @@ static void scroll_off (ETree *et);
static void scroll_on (ETree *et, guint scroll_direction);
static void hover_off (ETree *et);
static void hover_on (ETree *et, int x, int y);
+static void context_destroyed (gpointer data, GObject *ctx);
static void
et_disconnect_from_etta (ETree *et)
@@ -422,6 +423,10 @@ et_dispose (GObject *object)
if (et->priv->site)
e_tree_drag_source_unset (et);
+ if (et->priv->last_drop_context)
+ g_object_weak_unref (G_OBJECT(et->priv->last_drop_context), context_destroyed, et);
+ et->priv->last_drop_context = NULL;
+
gtk_widget_destroy (GTK_WIDGET (et->priv->table_canvas));
g_free(et->priv);
@@ -2806,7 +2811,7 @@ collapse_drag (ETree *et, ETreePath drop)
}
static void
-context_destroyed (gpointer data)
+context_destroyed (gpointer data, GObject *ctx)
{
ETree *et = data;
if (et->priv) {
@@ -2824,10 +2829,15 @@ context_destroyed (gpointer data)
static void
context_connect (ETree *et, GdkDragContext *context)
{
- if (g_dataset_get_data (context, "e-tree") == NULL) {
+ if (context == et->priv->last_drop_context)
+ return;
+
+ if (et->priv->last_drop_context)
+ g_object_weak_unref (G_OBJECT(et->priv->last_drop_context), context_destroyed, et);
+ else
g_object_ref (et);
- g_dataset_set_data_full (context, "e-tree", et, context_destroyed);
- }
+
+ g_object_weak_ref (G_OBJECT(context), context_destroyed, et);
}
static void
@@ -2864,8 +2874,8 @@ et_drag_motion(GtkWidget *widget,
et->priv->last_drop_x = x;
et->priv->last_drop_y = y;
et->priv->last_drop_time = time;
- et->priv->last_drop_context = context;
context_connect (et, context);
+ et->priv->last_drop_context = context;
if (et->priv->hover_idle_id != 0) {
if (abs (et->priv->hover_x - x) > 3 ||