macOS: Fix logical flaws in VLCRendererDiscovery
authorMarvin Scholz <epirat07@gmail.com>
Sat, 24 Jun 2017 16:35:28 +0000 (18:35 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Sat, 24 Jun 2017 16:45:19 +0000 (18:45 +0200)
modules/gui/macosx/VLCRendererDiscovery.m

index a511e4d..8270adc 100644 (file)
@@ -120,13 +120,13 @@ static void renderer_event_item_removed(vlc_renderer_discovery_t *rd,
     for (VLCRendererItem *item in _rendererItems) {
         if (item.rendererItem == base_item) {
             result_item = item;
-            return;
+            break;
         }
     }
     if (result_item) {
-        [_rendererItems removeObject:result_item];
         if (_delegate)
             [_delegate removedRendererItem:result_item from:self];
+        [_rendererItems removeObject:result_item];
     } else {
         msg_Err(p_intf, "VLCRendererDiscovery could not find item to remove!");
     }