]> git.sesse.net Git - vlc/blobdiff - src/control/core.c
libvlc_vlm_release : release events stuff Centralize vlm release operations in one...
[vlc] / src / control / core.c
index 4a258d26b686fe3448a20dd33d81216ea1075358..9f180eaa1a4e2cd0406df775054f720fb6a08904 100644 (file)
@@ -139,8 +139,9 @@ libvlc_instance_t * libvlc_new( int argc, const char *const *argv,
     }
 
     p_new->p_libvlc_int = p_libvlc_int;
-    p_new->p_vlm = NULL;
-    p_new->p_event_manager = NULL;
+    p_new->libvlc_vlm.p_vlm = NULL;
+    p_new->libvlc_vlm.p_event_manager = NULL;
+    p_new->libvlc_vlm.pf_release = NULL;
     p_new->b_playlist_locked = 0;
     p_new->ref_count = 1;
     p_new->verbosity = 1;
@@ -175,10 +176,8 @@ void libvlc_release( libvlc_instance_t *p_instance )
     {
         vlc_mutex_destroy( lock );
         vlc_mutex_destroy( &p_instance->event_callback_lock );
-        if( p_instance->p_event_manager )
-            libvlc_event_manager_release( p_instance->p_event_manager );
-        if( p_instance->p_vlm )
-            vlm_Delete( p_instance->p_vlm );
+        if( p_instance->libvlc_vlm.pf_release )
+            p_instance->libvlc_vlm.pf_release( p_instance );
         libvlc_InternalCleanup( p_instance->p_libvlc_int );
         libvlc_InternalDestroy( p_instance->p_libvlc_int );
         free( p_instance );