[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 23:06:42 CEST 2016


> Am 02.10.2016 um 17:29 schrieb Felix Paul Kühne <fkuehne at videolan.org>:
> 
> Hi David,
> 
>> On 2 Oct 2016, at 17:19, David Fuhrmann <david.fuhrmann at gmail.com> wrote:
>> 
>> 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?
> 
> The NSWindow may not respond to that selector as part of a race condition in AppKit when creating the window and VLC trying to set the colorspace before the window is ready yet. Weirdly, querying for the existence of the selector did not solve the problem for me.

Hi Felix,

TBH, this explanation does not make much sense to me. How should a selector be there, but not respond? Do you have a way to reproduce or a crash log? I strongly suspect you are not solving the root cause of your problem here…
If there is really a bug in AppKit, and there is absolutely no way to fix it any other way, then please document it clearly and file a Radar ticket.

In any case, this patch seems wrong:
You should not simply catch _all_ exceptions and hide errors. Such code does not fix anything. In this particular instance, its even worse if the error only occurs sporadically - in the error code path, you do not try to set the color space again later on, so randomly the user will have the wrong color space. Which makes debugging very hard.

Best regards,
David





More information about the vlc-devel mailing list