Re: Exit when a signal is recieved
Сергей Коныгин <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
Thanks!
Maybe I said it wrong. My question was exactly how to do the correct exit
using by wxWidgets. I decided to use the function
wxAppConsole::ExitMainLoop(). Everything works well: OnExit runs, global
destructors run.
void OnSignal( int sig )
{
GetMyApp()->ExitMainLoop();
}
вторник, 16 июля 2024 г. в 03:15:21 UTC+4, Vadim Zeitlin:
> 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/
>
--
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
---
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/2e759ad2-d9a1-49ef-ad30-b533968baa00n%40googlegroups.com.