[vlc-devel] [PATCH 1/5] libvlc: document which function was used to the user values

Rémi Denis-Courmont remi at remlab.net
Mon May 27 16:30:01 CEST 2019

Le maanantaina 27. toukokuuta 2019, 12.33.43 EEST Steve Lhomme a écrit :
> On 2019-05-27 11:13, Thomas Guillem wrote:
> > So, either we add back libvlc_free or we apply this set.
> IMO it's better to have a free per type.

In general, yes. But for strings it's IMO better to not have to free them at 

1) Remove any useless getter.
2) Else if the returned string cannot asynchronously change, return a constant 
pointer to it, and document until when it's valid.
3) Else take a buffer and buffer size to copy the string into, letting the 
caller do the allocation (and return the actual size).

We can't just replace free() with libvlc_free_string(). That will silently 
break the ABI - and to make things worse, it will break not in 4.0 but if/when 
libvlc_free_string() is changed...

Реми Дёни-Курмон

More information about the vlc-devel mailing list