[vlc-devel] [vlc-commits] vout-macosx: add exception handler for color space setter as the NSWindow may be nuked without us being notified about it

David Fuhrmann david.fuhrmann at gmail.com
Sun Oct 2 17:19:31 CEST 2016


> Am 26.09.2016 um 21:20 schrieb Felix Paul Kühne <git at videolan.org>:
> 
> vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Mon Sep 26 21:20:40 2016 +0200| [d52e38f3729cd959b8ff13f90fd3bdceb6d95c8d] | committer: Felix Paul Kühne
> 
> vout-macosx: add exception handler for color space setter as the NSWindow may be nuked without us being notified about it
> 
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d52e38f3729cd959b8ff13f90fd3bdceb6d95c8d
> ---
> 
> modules/video_output/macosx.m | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
> index 4458b46..6c13eb6 100644
> --- a/modules/video_output/macosx.m
> +++ b/modules/video_output/macosx.m
> @@ -838,11 +838,16 @@ static void OpenglSwap (vlc_gl_t *gl)
> {
>     [super viewWillMoveToWindow:newWindow];
> 
> -    if (newWindow != nil) {
> -        @synchronized(newWindow) {
> -            [newWindow setColorSpace:vd->sys->nsColorSpace];
> +    @try {
> +        if (newWindow != nil) {
> +            @synchronized(newWindow) {
> +                [newWindow setColorSpace:vd->sys->nsColorSpace];
> +            }
>         }
>     }
> +    @catch (NSException *exception) {
> +        msg_Warn(vd, "Setting the window color space failed due to an Obj-C exception (%s, %s", [exception.name UTF8String], [exception.reason UTF8String]);
> +    }
> }
> 

Hi Felix,

Could you detail what exception is supposed to be catched here? In the docu I just see that colorSpace is a property of NSWindow. How can it fail setting the color space here?

Best,
David


More information about the vlc-devel mailing list