[gtk+] Make sure to remove tooltip timeout.
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make sure to remove tooltip timeout.
- Date: Mon, 8 May 2017 22:12:27 +0000 (UTC)
commit 621d1bb4ec64c0412cda8bd6f335c0e3033c00ef
Author: Olof-Joachim Frahm <olof macrolet net>
Date: Sun Feb 5 19:08:56 2017 +0100
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
gtk/gtktooltip.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index ea4bf31..67fc943 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -732,6 +732,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);
@@ -744,6 +750,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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]