Merge pull request #23637 from donnadionne/backport_pr3

Fixing a member var to not be a reference. (backport to v1.31.x)
pull/23649/head
donnadionne 4 years ago committed by GitHub
commit 9192e594a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/core/ext/filters/client_channel/lb_policy/xds/xds_routing.cc

@ -185,7 +185,7 @@ class XdsRoutingLb : public LoadBalancingPolicy {
RefCountedPtr<XdsRoutingLb> xds_routing_policy_;
// Points to the corresponding key in XdsRoutingLb::actions_.
const std::string& name_;
const std::string name_;
OrphanablePtr<LoadBalancingPolicy> child_policy_;
@ -405,9 +405,10 @@ void XdsRoutingLb::UpdateLocked(UpdateArgs args) {
const RefCountedPtr<LoadBalancingPolicy::Config>& config = p.second;
auto it = actions_.find(name);
if (it == actions_.end()) {
it = actions_.emplace(std::make_pair(name, nullptr)).first;
it->second = MakeOrphanable<XdsRoutingChild>(
Ref(DEBUG_LOCATION, "XdsRoutingChild"), it->first);
it = actions_
.emplace(name, MakeOrphanable<XdsRoutingChild>(
Ref(DEBUG_LOCATION, "XdsRoutingChild"), name))
.first;
}
it->second->UpdateLocked(config, args.addresses, args.args);
}

Loading…
Cancel
Save