[vlc-commits] macOS: Do not form weak reference to NSWindowController

Marvin Scholz git at videolan.org
Sat Jun 24 12:37:12 CEST 2017


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Sat Jun 24 12:35:42 2017 +0200| [2c0fe5edac41de82dd801652e4b5592917604a27] | committer: Marvin Scholz

macOS: Do not form weak reference to NSWindowController

Use __unsafe_unretained instead of __weak, as we need to support 10.7
and it is not supported to form a weak reference to some types,
including NSWindowController, resulting in a runtime crash.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2c0fe5edac41de82dd801652e4b5592917604a27
---

 modules/gui/macosx/VLCVideoEffectsWindowController.m | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/VLCVideoEffectsWindowController.m b/modules/gui/macosx/VLCVideoEffectsWindowController.m
index a95e28f209..79f5f1d2a3 100644
--- a/modules/gui/macosx/VLCVideoEffectsWindowController.m
+++ b/modules/gui/macosx/VLCVideoEffectsWindowController.m
@@ -683,7 +683,8 @@
     [_textfieldPanel setCancelButtonString:_NS("Cancel")];
     [_textfieldPanel setOkButtonString:_NS("Save")];
 
-    __weak typeof(self) _self = self;
+    // TODO: Change to weak, when dropping 10.7 support
+    __unsafe_unretained typeof(self) _self = self;
     [_textfieldPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSString *resultingText) {
 
         NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
@@ -750,7 +751,8 @@
     [_popupPanel setCancelButtonString:_NS("Cancel")];
     [_popupPanel setPopupButtonContent:[[NSUserDefaults standardUserDefaults] objectForKey:@"VideoEffectProfileNames"]];
 
-    __weak typeof(self) _self = self;
+    // TODO: Change to weak, when dropping 10.7 support
+    __unsafe_unretained typeof(self) _self = self;
     [_popupPanel runModalForWindow:self.window completionHandler:^(NSInteger returnCode, NSInteger selectedIndex) {
 
         NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];



More information about the vlc-commits mailing list