Properly remove adb DNS services.

Bug: b/150136878
Bug: b/111434128

Test: make
Change-Id: Ibfb92a7c197a25fd1913107d277fbc5f78108c05
This commit is contained in:
Joshua Duong 2020-02-24 10:03:54 -08:00
parent bdbd0dde26
commit 79a452a923

View file

@ -409,9 +409,9 @@ static void adb_RemoveDNSService(const char* regType, const char* serviceName) {
}
std::string sName(serviceName);
std::remove_if(services->begin(), services->end(), [&sName](ResolvedService* service) {
return (sName == service->serviceName());
});
services->erase(std::remove_if(
services->begin(), services->end(),
[&sName](ResolvedService* service) { return (sName == service->serviceName()); }));
}
// Returns the version the device wanted to advertise,