]> git.sesse.net Git - vlc/commitdiff
libvlc_free: wrapper around free() when the C run-time is not known
authorRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 21 Feb 2009 14:41:04 +0000 (16:41 +0200)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Sat, 21 Feb 2009 16:15:09 +0000 (18:15 +0200)
include/vlc/libvlc.h
src/control/core.c
src/libvlc.sym

index 3b8d8fce9b79cde95abc6496e76fa77d80745e30..b953441816ffcdc815eac843a4db2eb92028d53a 100644 (file)
@@ -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 );
+
 /** @}*/
 
 /*****************************************************************************
index af592b9dd99cdd1a4087c0a9cf13488be678b4cc..e52b3cb653dc26e905b57a5ff6e19ce8027d3156 100644 (file)
@@ -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 );
+}
index 8de9c3f6f590b71a41e37a1ef800d7932834f9af..759744da73b0ae0bf2635fabf2c408ac5c289b82 100644 (file)
@@ -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