]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix an annoying warning from GTK on Ubuntu 14.04.
authorSimon Tatham <anakin@pobox.com>
Sun, 20 Apr 2014 16:48:18 +0000 (16:48 +0000)
committerSimon Tatham <anakin@pobox.com>
Sun, 20 Apr 2014 16:48:18 +0000 (16:48 +0000)
Timer objects evaporate when our timer_trigger callback is called, and
therefore we should not remember their ids beyond that time and
attempt to cancel them later. Previous versions of GTK silently
ignored us doing that, but upgrading to Ubuntu Trusty has given me a
version of GTK that complains about it, so let's stop doing it.

[originally from svn r10181]

unix/gtkwin.c

index 19ada0b8d5a045151510734ca5b65c04a2e80721..4f626cbe1ace982cd4612c8d87f9d1a1c112cec8 100644 (file)
@@ -1476,6 +1476,14 @@ static gint timer_trigger(gpointer data)
     unsigned long next, then;
     long ticks;
 
+    /*
+     * The timer we last scheduled via gtk_timeout_add has just
+     * triggered, and since we're about to return FALSE, it won't be
+     * resumed. So zero out its id, in case we don't overwrite it in
+     * the next loop.
+     */
+    timer_id = 0;
+
     if (run_timers(now, &next)) {
        then = now;
        now = GETTICKCOUNT();