[gtk+] Move timer removal in dispose
- From: Paolo Borelli <pborelli src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+] Move timer removal in dispose
- Date: Tue, 1 Sep 2009 13:50:38 +0000 (UTC)
commit f97a33ad9c6936b1ce6c5d4e937a17cc392b95b3
Author: Paolo Borelli <porelli gnome org>
Date: Mon Aug 3 21:39:34 2009 +0200
Move timer removal in dispose
Move removal of timer function in dispose to prevent potentially running
them on a diposed-but-not-finalized tooltip
gtk/gtktooltip.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 5ec6656..c816d0e 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -84,7 +84,7 @@ struct _GtkTooltipClass
static void gtk_tooltip_class_init (GtkTooltipClass *klass);
static void gtk_tooltip_init (GtkTooltip *tooltip);
-static void gtk_tooltip_finalize (GObject *object);
+static void gtk_tooltip_dispose (GObject *object);
static void gtk_tooltip_window_style_set (GtkTooltip *tooltip);
static gboolean gtk_tooltip_paint_window (GtkTooltip *tooltip);
@@ -106,7 +106,7 @@ gtk_tooltip_class_init (GtkTooltipClass *klass)
object_class = G_OBJECT_CLASS (klass);
- object_class->finalize = gtk_tooltip_finalize;
+ object_class->dispose = gtk_tooltip_dispose;
}
static void
@@ -166,7 +166,7 @@ gtk_tooltip_init (GtkTooltip *tooltip)
}
static void
-gtk_tooltip_finalize (GObject *object)
+gtk_tooltip_dispose (GObject *object)
{
GtkTooltip *tooltip = GTK_TOOLTIP (object);
@@ -194,9 +194,10 @@ gtk_tooltip_finalize (GObject *object)
gtk_tooltip_display_closed,
tooltip);
gtk_widget_destroy (tooltip->window);
+ tooltip->window = NULL;
}
- G_OBJECT_CLASS (gtk_tooltip_parent_class)->finalize (object);
+ G_OBJECT_CLASS (gtk_tooltip_parent_class)->dispose (object);
}
/* public API */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]