[vlc-devel] [PATCH] vout/macosx: simplify close and make sure all AppKit objects are released on the main thread

David Fuhrmann david.fuhrmann at gmail.com
Wed Sep 18 23:17:57 CEST 2019



> Am 18.09.2019 um 21:25 schrieb Felix Paul Kühne <fkuehne at videolan.org>:
> 
> Hi Thomas,
> 
>> On 18. Sep 2019, at 08:58, Thomas Guillem <thomas at gllm.fr> wrote:
>> 
>> We already know that we should not wait for the mainthread from the Close function, so it should be async.
> 
> OK!
> 
>> Why not using something like this ?
>> 
>>       [sys->glView performSelectorOnMainThread:@selector(release)
>>                                     withObject:nil
>>                                  waitUntilDone:NO];
> 
> dispatch_async on the main queue does exactly the same, but is slightly faster on execution. Additionally, using the block syntax greatly improves readability and you don’t need to switch context for each of the main thread calls within the Close function.

Hi,

dispatch_async seems ok for me as well. But I would probably try to get rid of the sys usage in the block at all, and only capture the objc object variables directly.

BR. David


More information about the vlc-devel mailing list