Commit a20aa5a9 authored by noamsml@chromium.org's avatar noamsml@chromium.org

Speculatively fix OSX crashes involving service removal

Don't signal a service is removed unless we've signaled it was added.

BUG=365835

Review URL: https://codereview.chromium.org/346873002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278542 0039d316-1c4b-4281-b951-d872f2087c98
parent 7d87facf
......@@ -431,11 +431,12 @@ ServiceResolverImplMac::GetContainerForTesting() {
- (void)netServiceBrowser:(NSNetServiceBrowser *)netServiceBrowser
didRemoveService:(NSNetService *)netService
moreComing:(BOOL)moreServicesComing {
container_->OnServicesUpdate(local_discovery::ServiceWatcher::UPDATE_REMOVED,
[[netService name] UTF8String]);
NSUInteger index = [services_ indexOfObject:netService];
if (index != NSNotFound) {
container_->OnServicesUpdate(
local_discovery::ServiceWatcher::UPDATE_REMOVED,
[[netService name] UTF8String]);
// Stop monitoring this service for updates.
[[services_ objectAtIndex:index] stopMonitoring];
[services_ removeObjectAtIndex:index];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment