[gtk+] gtk_widget_on_frame_clock_update: ref the widget
- From: Owen Taylor <otaylor src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtk_widget_on_frame_clock_update: ref the widget
- Date: Mon, 18 Feb 2013 20:32:44 +0000 (UTC)
commit 3e81854351920076ede73a76c71431825c35d6c0
Author: Owen W. Taylor <otaylor fishsoup net>
Date: Mon Feb 18 14:55:03 2013 -0500
gtk_widget_on_frame_clock_update: ref the widget
Handle a widget being destroyed while in a tick callback by
referencing the widget while dispatching tick callbacks.
gtk/gtkwidget.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8a7fb18..bafee84 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4577,6 +4577,8 @@ gtk_widget_on_frame_clock_update (GdkFrameClock *frame_clock,
GtkWidgetPrivate *priv = widget->priv;
GList *l;
+ g_object_ref (widget);
+
for (l = priv->tick_callbacks; l;)
{
GtkTickCallbackInfo *info = l->data;
@@ -4597,6 +4599,8 @@ gtk_widget_on_frame_clock_update (GdkFrameClock *frame_clock,
unref_tick_callback_info (widget, info, l);
l = next;
}
+
+ g_object_unref (widget);
}
static guint tick_callback_id;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]