onCloseConsole

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

onCloseConsole

Ian Bartholomew-21
Andy/Blair,

I'm not sure if this is a bug or if I'm missing some extra functionality but
...

I am playing about with a console app where the work is done inside a forked
repeat loop (with sleep).  It all works as expected until I close the
command window down.

If I terminate the app with Ctrl-Break or Ctrl-C then the app terminates
(after passing through my #onExit override) and the command window closes.

If I press the command window's close button, or select close from it's file
menu, then the Dolphin app closes, #onExit is visited, but the command
window itself doesn't close.  There is the 5 second pause and the "Windows
cannot end this program ..." prompt appears.

Looking through the code it appears that the other responses to console
control messages, via SessionManager>>onConsoleCtrl:, all end by deferring a
Dolphin #quit.  The response to CTRL_CLOSE_EVENT is handled differently and
routed via a #onCloseConsole to, I assume, allow applications to close down
gracefully, but the #exit is then performed using an immediate message send,
not deferred.

If I change ConsoleSessionManager>>onCloseConsole from

self quit: -1

to

self inputState postQuit: -1

then all works as I would, possibly erroneously, expect it to.

--
Ian

Use the Reply-To address to contact me (limited validity).
Mail sent to the From address is ignored.