Roll forward to cl/343785060

Signed-off-by: hai007 <hais@google.com>
This commit is contained in:
hai007
2020-11-23 22:28:06 -08:00
parent 25bf896257
commit e6d52359cf
27 changed files with 500 additions and 742 deletions
@@ -34,6 +34,7 @@ const std::size_t kMaxEndpointInfoLength = 131u;
ServiceControllerRouter::~ServiceControllerRouter() {
NEARBY_LOG(INFO, "ServiceControllerRouter going down.");
service_controller_.reset();
// And make sure that cleanup is the last thing we do.
serializer_.Shutdown();
}
@@ -390,8 +391,8 @@ void ServiceControllerRouter::ReleaseServiceControllerForClient(
ClientProxy* client) {
clients_.erase(client);
// service_controller_ won't be released here. Instead, in desctructor.
if (clients_.empty()) {
service_controller_.reset();
current_strategy_ = Strategy{};
}
}