Re: Exit when a signal is recieved
Vadim Zeitlin <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
On Sat, 13 Jul 2024 06:09:25 -0700 (PDT) Сергей Коныгин wrote:
> My console program must exits normally when a signal SIGINT is received
> (OnExit and the global objects destructors should run). How can I correctly
> send an exit event from OnSignal function to the application?
This depends on what your program is doing. If it's blocking on some
select() (or equivalent), you'd usually use a pipe to wake it up. If it's
busy-looping, you'd just set an (atomic) variable.
As this is not really wx-specific, you can find plenty of examples in Unix
programming guides etc.
Good luck,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
signature.asc
(application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCZpWtewAKCRAG6kHeT2we hiOpAKCYE/Sy/tIjJ7Fg/VJ6M79pAZRbGwCfU5nblKEFEyjKBQh7nbPveIRbnfw= =Xj+j -----END PGP SIGNATURE-----