bonjour: Work around a macOS 10.12 bug
authorMarvin Scholz <epirat07@gmail.com>
Tue, 6 Dec 2016 08:29:42 +0000 (09:29 +0100)
committerMarvin Scholz <epirat07@gmail.com>
Tue, 6 Dec 2016 09:25:25 +0000 (10:25 +0100)
NSNetServiceBrowser and NSNetService do not properly release the
delegates, see https://crbug.com/657495 and
https://openradar.appspot.com/28943305

modules/services_discovery/bonjour.m

index cd9cb3a..3181fbf 100644 (file)
@@ -207,6 +207,10 @@ NSString *const VLCBonjourRendererDemux         = @"VLCBonjourRendererDemux";
 {
     [_serviceBrowsers makeObjectsPerformSelector:@selector(stop)];
 
+    /* Work around a macOS 10.12 bug, see https://openradar.appspot.com/28943305 */
+    [_serviceBrowsers makeObjectsPerformSelector:@selector(setDelegate:) withObject:nil];
+    [_resolvedNetServices makeObjectsPerformSelector:@selector(setDelegate:) withObject:nil];
+
     for (NSValue *item in _inputItemsForNetServices) {
         if (_isRendererDiscovery) {
             [self removeRawRendererItem:item];