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.
This commit is contained in:
Owen W. Taylor
2013-02-18 14:55:03 -05:00
parent e6b5608f43
commit 3e81854351

View File

@ -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;