Fix CTRL-C on non event loop apps

This commit is contained in:
2025-07-28 02:10:07 -05:00
parent 739da024a6
commit afdcab8cd9
2 changed files with 8 additions and 2 deletions

View File

@@ -94,6 +94,7 @@ namespace Tesses::Framework
}
void TF_RunEventLoop()
{
TF_InitEventLoop();
while(isRunning)
{
TF_RunEventLoopItteration();
@@ -173,6 +174,11 @@ namespace Tesses::Framework
#endif
}
void TF_InitEventLoop()
{
signal(SIGINT,_sigInt);
signal(SIGTERM, _sigInt);
}
void TF_Init()
{
@@ -221,8 +227,7 @@ if (iResult != 0) {
// Initialize the default gamepad (which reads handheld mode inputs as well as the first connected controller)
#else
signal(SIGPIPE,SIG_IGN);
signal(SIGINT,_sigInt);
signal(SIGTERM, _sigInt);
#endif
}