Make sure to remove tooltip timeout.
Otherwise in GC-ed environments the `g_source_remove` call during disposal might be called on an already removed source, which results in unnecessary console output. https://bugzilla.gnome.org/show_bug.cgi?id=778301
This commit is contained in:
parent
f2f09b9574
commit
c05c78f9c9
@ -761,6 +761,12 @@ tooltip_browse_mode_expired (gpointer data)
|
|||||||
tooltip->browse_mode_enabled = FALSE;
|
tooltip->browse_mode_enabled = FALSE;
|
||||||
tooltip->browse_mode_timeout_id = 0;
|
tooltip->browse_mode_timeout_id = 0;
|
||||||
|
|
||||||
|
if (tooltip->timeout_id)
|
||||||
|
{
|
||||||
|
g_source_remove (tooltip->timeout_id);
|
||||||
|
tooltip->timeout_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* destroy tooltip */
|
/* destroy tooltip */
|
||||||
display = gtk_widget_get_display (tooltip->window);
|
display = gtk_widget_get_display (tooltip->window);
|
||||||
g_object_set_qdata (G_OBJECT (display), quark_current_tooltip, NULL);
|
g_object_set_qdata (G_OBJECT (display), quark_current_tooltip, NULL);
|
||||||
@ -773,6 +779,12 @@ gtk_tooltip_display_closed (GdkDisplay *display,
|
|||||||
gboolean was_error,
|
gboolean was_error,
|
||||||
GtkTooltip *tooltip)
|
GtkTooltip *tooltip)
|
||||||
{
|
{
|
||||||
|
if (tooltip->timeout_id)
|
||||||
|
{
|
||||||
|
g_source_remove (tooltip->timeout_id);
|
||||||
|
tooltip->timeout_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
g_object_set_qdata (G_OBJECT (display), quark_current_tooltip, NULL);
|
g_object_set_qdata (G_OBJECT (display), quark_current_tooltip, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user