From 87bd714c4975daa02a0b6f1ad5e0318f213a5cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Paul=20K=C3=BChne?= <felix@feepk.net> Date: Sun, 28 Apr 2019 11:41:09 +0200 Subject: [PATCH] macosx/menu: remove last occurence of vlc_object_release (closes #22204) --- modules/gui/macosx/menus/VLCMainMenu.m | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/gui/macosx/menus/VLCMainMenu.m b/modules/gui/macosx/menus/VLCMainMenu.m index 49ab9dc05338..bd42cd433a77 100644 --- a/modules/gui/macosx/menus/VLCMainMenu.m +++ b/modules/gui/macosx/menus/VLCMainMenu.m @@ -1902,8 +1902,9 @@ typedef NS_ENUM(NSInteger, VLCObjectType) { _variableName = strdup(name); _variableType = type; _variableValue = value; - if ((type & VLC_VAR_TYPE) == VLC_VAR_STRING) + if ((type & VLC_VAR_TYPE) == VLC_VAR_STRING) { _variableValue.psz_string = strdup(value.psz_string); + } } return(self); @@ -1911,10 +1912,23 @@ typedef NS_ENUM(NSInteger, VLCObjectType) { - (void)dealloc { - if (_vlcObject && _objectType != VLCObjectTypeInterface) - vlc_object_release(_vlcObject); - if ((_variableType & VLC_VAR_TYPE) == VLC_VAR_STRING) + if (_vlcObject) { + switch (_objectType) { + case VLCObjectTypeAout: + aout_Release((audio_output_t *)_vlcObject); + break; + case VLCObjectTypeVout: + vout_Release((vout_thread_t *)_vlcObject); + break; + + default: + // the interface will be released by the core shortly + break; + } + } + if ((_variableType & VLC_VAR_TYPE) == VLC_VAR_STRING) { free(_variableValue.psz_string); + } free(_variableName); } -- GitLab