[Gambas-user] Stop iNotify Watch
Tobias Boege
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."*
> https://gambaswiki.org/wiki/lang/wait
>
> 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:
http://gambaswiki.org/wiki/lang/quit:
> 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.
Best,
Tobias
--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk
More information about the User
mailing list