mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 14:31:50 +00:00
add SIGTERM handler
This commit is contained in:
parent
46d3e5c7e1
commit
8b2094c628
1 changed files with 4 additions and 2 deletions
|
|
@ -10,7 +10,7 @@
|
||||||
static debug::Logger logger("main");
|
static debug::Logger logger("main");
|
||||||
|
|
||||||
static void sigterm_handler(int signum) {
|
static void sigterm_handler(int signum) {
|
||||||
logger.info() << "SIGTERM received " << signum;
|
logger.info() << (signum == SIGTERM ? "SIGTERM" : "SIGINT") << " received";
|
||||||
Engine::getInstance().quit();
|
Engine::getInstance().quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +33,9 @@ int main(int argc, char** argv) {
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
std::signal(SIGTERM, sigterm_handler);
|
std::signal(SIGTERM, sigterm_handler);
|
||||||
|
#ifdef NDEBUG
|
||||||
|
std::signal(SIGINT, sigterm_handler);
|
||||||
|
#endif
|
||||||
debug::Logger::init(coreParameters.userFolder.string() + "/latest.log");
|
debug::Logger::init(coreParameters.userFolder.string() + "/latest.log");
|
||||||
platform::configure_encoding();
|
platform::configure_encoding();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue