[Gambas-user] Stop iNotify Watch
tobs at taboege.de
Sat Oct 30 18:29:16 CEST 2021
On Sat, 30 Oct 2021, Jussi Lahtinen wrote:
> > Jussi: Uh, thanks...
> From the documentation: *"If you call WAIT from an event handler, you may
> create infinite recursions, and then stack overflows."*
> So, I recommend to correct that, before anything else.
Yes, and the overflowing stack causes a segfault. But in this case, it is
probably not caused by the event loop being called recursively with Wait,
but by something very similar. The documentation also says:
> This instruction is not very successful in freeing things with
> GUI programs. So you should use it only with console applications.
Without having read the GUI source code, I could imagine that calling
Quit from Form_Close causes infinite recursion, stack exhaustion and
thus the segfault. Form_Close is part of the graceful shutdown process
of the GUI application, but at the time the event handler runs, the
window still exists. You interrupt the shutdown process to start a new
one by calling Quit and the window, still existing because one of its
event handlers is still running, fires the Close event recursively.
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User