]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Make GTK idle and quit function setup idempotent.
authorSimon Tatham <anakin@pobox.com>
Sat, 30 Nov 2013 18:04:57 +0000 (18:04 +0000)
committerSimon Tatham <anakin@pobox.com>
Sat, 30 Nov 2013 18:04:57 +0000 (18:04 +0000)
commitdf1eee6027bcbf1fd3a2ac27241db9742cadcab5
tree39f159f67a8e4b1e199e8e913703c2c7e20dfd0a
parent7a53bd65d70fad73dbd6832497965fa11b2a357b
Make GTK idle and quit function setup idempotent.

I found last week that when a local proxy process terminated
unexpectedly, Unix PuTTY went into a tight loop calling quit
functions, because if idle_toplevel_callback_func is called from
inside a subsidiary gtk_main then it will schedule a quit function and
_not_ disable itself, so that that quit function keeps being
rescheduled on subsequent calls.

To fix, I've tried to make the whole handling of idle and quit
functions more sensibly robust: we keep our own boolean flag
indicating whether each of our functions has already been scheduled
with GTK, and if so, we don't schedule the same one again. Also, when
idle_toplevel_callback_func schedules a quit function, it should
unschedule itself since it's now done everything it can until a
gtk_main instance quits.

[originally from svn r10100]
unix/gtkwin.c