[ORC] Shut down services in SimpleRemoteEPCServer.

This should have been included with ExecutorBootstrapService in 78b083dbb7,
but was accidentally left out. It give services a chance to release any
resources that they have acquired.
This commit is contained in:
Lang Hames committed 2021-09-23 16:27:28 -07:00
1 parent 76d845cb16
commit c965fde7c2
1 file changed
+7
@@ -113,6 +113,13 @@ void SimpleRemoteEPCServer::handleDisconnect(Error Err) {
// Wait for dispatcher to clear.
D->shutdown();
// Shut down services.
while (!Services.empty()) {
ShutdownErr =
joinErrors(std::move(ShutdownErr), Services.back()->shutdown());
Services.pop_back();
}
std::lock_guard<std::mutex> Lock(ServerStateMutex);
ShutdownErr = joinErrors(std::move(ShutdownErr), std::move(Err));
RunState = ServerShutDown;