Fix an annoying warning from GTK on Ubuntu 14.04.

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]
This commit is contained in:
Simon Tatham 2014-04-20 16:48:18 +00:00
Родитель bd20c418a2
Коммит e4c4bd2092
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -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();