Allow the group host to terminate cleanly

...before terminating it forcefully. Not sure why this
`TerminateProcess()` was here instead of in `group-host.cpp` in the
first place. This way we don't have to duplicate any destructor
behaviour.
This commit is contained in:
Robbert van der Helm
2021-10-16 02:00:39 +02:00
parent 1b662c07a7
commit e3f0926aef
+2 -9
View File
@@ -334,15 +334,8 @@ void GroupBridge::maybe_schedule_shutdown(
logger.log(
"All plugins have exited, shutting down the group process");
// main_context.stop();
// FIXME: See the comment in `individual-host.cpp`. Because of that
// we also need to manually clean up the socket endpoint.
// ...was there a reason why we can't do this terminate at
// the end of `group-host.cpp`? I don't think there is. Then
// we don't need to duplicate this nasty destructor
// behaviour.
fs::remove(group_socket_endpoint.path());
TerminateProcess(GetCurrentProcess(), 0);
// The whole process will exit in `group-host.cpp` because of this
main_context.stop();
}
});
}