traintastic: renamed shutdown() to exit()
Dieser Commit ist enthalten in:
Ursprung
2a1346e0d9
Commit
5ddbd599d9
@ -112,7 +112,7 @@ bool Traintastic::run()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Traintastic::shutdown()
|
void Traintastic::exit()
|
||||||
{
|
{
|
||||||
console->notice(id, "Shutting down");
|
console->notice(id, "Shutting down");
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ class Traintastic : public Object
|
|||||||
std::filesystem::path worldDir() const { return m_dataDir / "world"; }
|
std::filesystem::path worldDir() const { return m_dataDir / "world"; }
|
||||||
|
|
||||||
bool run();
|
bool run();
|
||||||
void shutdown();
|
void exit();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -47,7 +47,7 @@ void signalHandler(int signum)
|
|||||||
[signum]()
|
[signum]()
|
||||||
{
|
{
|
||||||
Traintastic::instance->console->notice(Traintastic::id, std::string("Received signal: ") + strsignal(signum));
|
Traintastic::instance->console->notice(Traintastic::id, std::string("Received signal: ") + strsignal(signum));
|
||||||
Traintastic::instance->shutdown();
|
Traintastic::instance->exit();
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -156,8 +156,13 @@ int main(int argc, char* argv[])
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
Traintastic::instance = std::make_shared<Traintastic>(dataDir);
|
Traintastic::instance = std::make_shared<Traintastic>(dataDir);
|
||||||
|
std::cerr << "before run" << std::endl;
|
||||||
status = Traintastic::instance->run() ? EXIT_SUCCESS : EXIT_FAILURE;
|
status = Traintastic::instance->run() ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||||
|
std::cerr << "after run" << std::endl;
|
||||||
|
std::cerr << Traintastic::instance.use_count() << std::endl;
|
||||||
Traintastic::instance.reset();
|
Traintastic::instance.reset();
|
||||||
|
std::cerr << Traintastic::instance.use_count() << std::endl;
|
||||||
|
std::cerr << "after reset" << std::endl;
|
||||||
}
|
}
|
||||||
catch(const std::exception& e)
|
catch(const std::exception& e)
|
||||||
{
|
{
|
||||||
|
|||||||
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren