[gtk+] scrolled window: Don't leak timeout sources
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] scrolled window: Don't leak timeout sources
- Date: Sun, 13 Aug 2017 13:29:05 +0000 (UTC)
commit b52c1cb8dcdfc2d7ac374c53ab527cca0fba7be4
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Aug 13 09:24:50 2017 -0400
scrolled window: Don't leak timeout sources
We must only create a new source if there isn't one already,
otherwise we override the ID and leak the previous one.
gtk/gtkscrolledwindow.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index f791303..f49c832 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -3760,14 +3760,12 @@ indicator_set_fade (Indicator *indicator,
visible = indicator->current_pos != 0.0 || indicator->target_pos != 0.0;
- if (visible)
+ if (visible && indicator->conceil_timer == 0)
{
-if (indicator->conceil_timer != 0) g_print ("leaking conceil_timer!\n");
indicator->conceil_timer = g_timeout_add (INDICATOR_FADE_OUT_TIME, maybe_hide_indicator, indicator);
g_source_set_name_by_id (indicator->conceil_timer, "[gtk+] maybe_hide_indicator");
}
- if (!visible && gtk_widget_get_mapped (indicator->scrollbar) &&
- indicator->conceil_timer != 0)
+ if (!visible && indicator->conceil_timer != 0)
{
g_source_remove (indicator->conceil_timer);
indicator->conceil_timer = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]