Minor changes.

This was me fixing a few bugs and finding that Gent was working on some
of the same ones, then awkwardly merging the changes together.
This commit is contained in:
2020-09-12 22:43:04 +02:00
parent a4716b0164
commit c1ac2250a0
3 changed files with 50 additions and 37 deletions

View File

@@ -28,8 +28,8 @@
#endif
#endif
CNShardServer *shardServer;
std::thread *shardThread;
CNShardServer *shardServer = nullptr;
std::thread *shardThread = nullptr;
void startShard(CNShardServer* server) {
server->start();
@@ -39,8 +39,11 @@ void startShard(CNShardServer* server) {
// terminate gracefully on SIGINT (for gprof)
void terminate(int arg) {
std::cout << "OpenFusion: terminating." << std::endl;
shardServer->kill();
shardThread->join();
if (shardServer != nullptr && shardThread != nullptr) {
shardServer->kill();
shardThread->join();
}
#if defined(__SANITIZE_ADDRESS__)
TableData::cleanup();