From: RĂ©mi Denis-Courmont Date: Sat, 21 Feb 2009 14:41:04 +0000 (+0200) Subject: libvlc_free: wrapper around free() when the C run-time is not known X-Git-Tag: 1.0.0-pre1~515 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=d2e7edbdb2edf1afde6e67bef8161025dcbcad4a;p=vlc libvlc_free: wrapper around free() when the C run-time is not known --- diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h index 3b8d8fce9b..b953441816 100644 --- a/include/vlc/libvlc.h +++ b/include/vlc/libvlc.h @@ -224,6 +224,13 @@ struct vlc_object_t; */ VLC_PUBLIC_API struct vlc_object_t *libvlc_get_vlc_instance(libvlc_instance_t *); +/** + * Frees an heap allocation (char *) returned by a LibVLC API. + * If you know you're using the same underlying C run-time as the LibVLC + * implementation, then you can call ANSI C free() directly instead. + */ +VLC_PUBLIC_API void libvlc_free( void *ptr ); + /** @}*/ /***************************************************************************** diff --git a/src/control/core.c b/src/control/core.c index af592b9dd9..e52b3cb653 100644 --- a/src/control/core.c +++ b/src/control/core.c @@ -215,3 +215,8 @@ vlc_object_t *libvlc_get_vlc_instance( libvlc_instance_t* p_instance ) vlc_object_hold( p_instance->p_libvlc_int ) ; return (vlc_object_t*) p_instance->p_libvlc_int ; } + +void libvlc_free( void *ptr ) +{ + free( ptr ); +} diff --git a/src/libvlc.sym b/src/libvlc.sym index 8de9c3f6f5..759744da73 100644 --- a/src/libvlc.sym +++ b/src/libvlc.sym @@ -31,6 +31,7 @@ libvlc_exception_get_message libvlc_exception_init libvlc_exception_raise libvlc_exception_raised +libvlc_free libvlc_get_changeset libvlc_get_compiler libvlc_get_fullscreen