]> git.sesse.net Git - vlc/commitdiff
free callbacks on libvlc destruction
authorFilippo Carone <littlejohn@videolan.org>
Sat, 19 May 2007 18:50:52 +0000 (18:50 +0000)
committerFilippo Carone <littlejohn@videolan.org>
Sat, 19 May 2007 18:50:52 +0000 (18:50 +0000)
include/vlc/libvlc_structures.h
src/control/core.c
src/control/libvlc_internal.h

index eeafdb4adbbd7f2cfbfeb3516d9101bbb09ecfc0..e9708112a2e3a68e3f83a5b6d4ae2bad14668828 100644 (file)
@@ -32,6 +32,11 @@ extern "C" {
 
 /** This structure is opaque. It represents a libvlc instance */
 typedef struct libvlc_instance_t libvlc_instance_t;
+
+/*****************************************************************************
+ * Exceptions
+ *****************************************************************************/
+
 /** defgroup libvlc_exception Exceptions
  * \ingroup libvlc
  * LibVLC Exceptions handling
@@ -56,7 +61,6 @@ typedef struct
  * @{
  */
 
-
 typedef struct {
     int i_id;
     char * psz_uri;
index aacadf209218fa2b7811015010f7479ea374e027..401119a43070d57081764ee01d978dc7ad61a542 100644 (file)
@@ -107,6 +107,15 @@ libvlc_instance_t * libvlc_new( int argc, char **argv,
 
 void libvlc_destroy( libvlc_instance_t *p_instance, libvlc_exception_t *p_e )
 {
+    struct libvlc_callback_entry_list_t *p_listitem = p_instance->p_callback_list;
+
+    while( p_listitem )
+    {
+        struct libvlc_callback_entry_list *p_nextlistitem = p_listitem->next;
+        free( p_listitem );
+        p_listitem = p_nextlistitem;
+    }
+    
     libvlc_InternalCleanup( p_instance->p_libvlc_int );
     libvlc_InternalDestroy( p_instance->p_libvlc_int, VLC_FALSE );
 }
index afb949282b4fff7549403859145dd32c0a1492f7..41e7352ef9b32c5bec7cd5ca73e0f69455a63aba 100644 (file)
@@ -70,7 +70,6 @@ struct libvlc_instance_t
     struct libvlc_callback_entry_list_t *p_callback_list;
 };
 
-
 struct libvlc_input_t
 {
     int i_input_id;  ///< Input object id. We don't use a pointer to