macOS: Fix ownership in ExtensionsDialogProvider
authorMarvin Scholz <epirat07@gmail.com>
Mon, 3 Apr 2017 07:32:26 +0000 (09:32 +0200)
committerMarvin Scholz <epirat07@gmail.com>
Mon, 3 Apr 2017 07:32:26 +0000 (09:32 +0200)
Fix #17912

modules/gui/macosx/VLCExtensionsDialogProvider.m

index 9dd1354..953bd33 100644 (file)
@@ -381,7 +381,7 @@ static void extensionDialogCallback(extension_dialog_t *p_ext_dialog,
         if (!control && !shouldDestroy) {
             control = createControlFromWidget(widget, self);
             updateControlFromWidget(control, widget, self);
-            widget->p_sys_intf = (__bridge void *)control;
+            widget->p_sys_intf = (__bridge_retained void *)control;
             update = YES; // Force update and repositionning
             [control setHidden:widget->b_hide];
         }
@@ -408,6 +408,7 @@ static void extensionDialogCallback(extension_dialog_t *p_ext_dialog,
         if (shouldDestroy) {
             VLCDialogGridView *gridView = (VLCDialogGridView *)[dialogWindow contentView];
             [gridView removeSubview:control];
+            CFRelease(widget->p_sys_intf);
             widget->p_sys_intf = NULL;
         }
     }