mirror of
https://onedev.site.tesses.net/tesses-framework
synced 2026-02-08 15:55:46 +00:00
Fix CTRL-C on non event loop apps
This commit is contained in:
@@ -87,6 +87,7 @@ namespace Tesses::Framework
|
|||||||
void TF_Init();
|
void TF_Init();
|
||||||
void TF_InitWithConsole();
|
void TF_InitWithConsole();
|
||||||
void TF_ConnectToSelf(uint16_t port);
|
void TF_ConnectToSelf(uint16_t port);
|
||||||
|
void TF_InitEventLoop();
|
||||||
void TF_RunEventLoop();
|
void TF_RunEventLoop();
|
||||||
void TF_RunEventLoopItteration();
|
void TF_RunEventLoopItteration();
|
||||||
bool TF_IsRunning();
|
bool TF_IsRunning();
|
||||||
|
|||||||
@@ -94,6 +94,7 @@ namespace Tesses::Framework
|
|||||||
}
|
}
|
||||||
void TF_RunEventLoop()
|
void TF_RunEventLoop()
|
||||||
{
|
{
|
||||||
|
TF_InitEventLoop();
|
||||||
while(isRunning)
|
while(isRunning)
|
||||||
{
|
{
|
||||||
TF_RunEventLoopItteration();
|
TF_RunEventLoopItteration();
|
||||||
@@ -173,6 +174,11 @@ namespace Tesses::Framework
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
void TF_InitEventLoop()
|
||||||
|
{
|
||||||
|
signal(SIGINT,_sigInt);
|
||||||
|
signal(SIGTERM, _sigInt);
|
||||||
|
}
|
||||||
void TF_Init()
|
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)
|
// Initialize the default gamepad (which reads handheld mode inputs as well as the first connected controller)
|
||||||
#else
|
#else
|
||||||
signal(SIGPIPE,SIG_IGN);
|
signal(SIGPIPE,SIG_IGN);
|
||||||
signal(SIGINT,_sigInt);
|
|
||||||
signal(SIGTERM, _sigInt);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user