[vlc-devel] [vlc-commits] macosx: fix conditional crash when setting the MRL field
David Fuhrmann
david.fuhrmann at gmail.com
Wed Jul 3 15:58:44 CEST 2013
Am 02.07.2013 um 23:14 schrieb Felix Paul Kühne <git at videolan.org>:
> vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jul 2 23:11:40 2013 +0200| [04b45e8ffd279a6df19ff96d6157a688bd6b7a08] | committer: Felix Paul Kühne
>
> macosx: fix conditional crash when setting the MRL field
>
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=04b45e8ffd279a6df19ff96d6157a688bd6b7a08
> ---
>
> modules/gui/macosx/open.m | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/modules/gui/macosx/open.m b/modules/gui/macosx/open.m
> index 5d965a4..7ee04b5 100644
> --- a/modules/gui/macosx/open.m
> +++ b/modules/gui/macosx/open.m
> @@ -338,7 +338,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
>
> o_mrl = newMRL;
> [o_mrl retain];
> - [o_mrl_fld setStringValue: o_mrl];
> + [o_mrl_fld performSelectorOnMainThread:@selector(setStringValue:) withObject:o_mrl waitUntilDone:NO];
> if ([o_mrl length] > 0)
> [o_btn_ok setEnabled: YES];
Hi Felix,
I am wondering what's the code path for this crash? And why is it ok to call setEnabled on a non-main thread but need to call setStringValue on the main thread?
Perhaps it would make sense to add a small comment, if this is really the only possible fix. Otherwise we might ask later why we have this performSelectorOnMain here.
With best regards,
David
More information about the vlc-devel
mailing list