Make sure to remove tooltip timeout.
authorOlof-Joachim Frahm <olof@macrolet.net>
Sun, 5 Feb 2017 18:08:56 +0000 (19:08 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 9 May 2017 10:55:21 +0000 (06:55 -0400)
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

gtk/gtktooltip.c

index 19a496337e476e877ade3a80ecf046662145b1f8..84ed9fdeed726b9cefd383bc66f252731b8f4b31 100644 (file)
@@ -761,6 +761,12 @@ tooltip_browse_mode_expired (gpointer data)
   tooltip->browse_mode_enabled = FALSE;
   tooltip->browse_mode_timeout_id = 0;
 
+  if (tooltip->timeout_id)
+    {
+      g_source_remove (tooltip->timeout_id);
+      tooltip->timeout_id = 0;
+    }
+
   /* destroy tooltip */
   display = gtk_widget_get_display (tooltip->window);
   g_object_set_qdata (G_OBJECT (display), quark_current_tooltip, NULL);
@@ -773,6 +779,12 @@ gtk_tooltip_display_closed (GdkDisplay *display,
                            gboolean    was_error,
                            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);
 }