From d2e7edbdb2edf1afde6e67bef8161025dcbcad4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?R=C3=A9mi=20Denis-Courmont?= Date: Sat, 21 Feb 2009 16:41:04 +0200 Subject: [PATCH] libvlc_free: wrapper around free() when the C run-time is not known --- include/vlc/libvlc.h | 7 +++++++ src/control/core.c | 5 +++++ src/libvlc.sym | 1 + 3 files changed, 13 insertions(+) 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 -- 2.39.2