mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add SIGTERM handler
This commit is contained in:
parent
02554e469a
commit
b2cda8070b
1 changed files with 7 additions and 1 deletions
|
|
@ -3,11 +3,16 @@
|
|||
#include "util/command_line.hpp"
|
||||
#include "debug/Logger.hpp"
|
||||
|
||||
#include <csignal>
|
||||
#include <iostream>
|
||||
#include <stdexcept>
|
||||
|
||||
static debug::Logger logger("main");
|
||||
|
||||
static void sigterm_handler(int signum) {
|
||||
Engine::getInstance().quit();
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
CoreParameters coreParameters;
|
||||
try {
|
||||
|
|
@ -18,7 +23,8 @@ int main(int argc, char** argv) {
|
|||
std::cerr << err.what() << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
std::signal(SIGTERM, sigterm_handler);
|
||||
|
||||
debug::Logger::init(coreParameters.userFolder.string()+"/latest.log");
|
||||
platform::configure_encoding();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue