[vlc-devel] commit: Keep the instance until after the media player is destroyed ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Feb 6 17:43:37 CET 2010


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Feb  6 18:43:14 2010 +0200| [55ba176369bb8ea71c2d7a19f26c77dabcd9dffc] | committer: Rémi Denis-Courmont 

Keep the instance until after the media player is destroyed

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=55ba176369bb8ea71c2d7a19f26c77dabcd9dffc
---

 src/control/media_player.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/control/media_player.c b/src/control/media_player.c
index 1160642..99e4df0 100644
--- a/src/control/media_player.c
+++ b/src/control/media_player.c
@@ -415,6 +415,7 @@ libvlc_media_player_new( libvlc_instance_t *instance )
      */
     var_AddCallback(mp->p_libvlc, "snapshot-file", snapshot_was_taken, mp);
 
+    libvlc_retain(instance);
     return mp;
 }
 
@@ -466,7 +467,10 @@ static void libvlc_media_player_destroy( libvlc_media_player_t *p_mi )
     libvlc_event_manager_release( p_mi->p_event_manager );
     libvlc_media_release( p_mi->p_md );
     vlc_mutex_destroy( &p_mi->object_lock );
+
+    libvlc_instance_t *instance = p_mi->p_libvlc_instance;
     vlc_object_release( p_mi );
+    libvlc_release(instance);
 }
 
 /**************************************************************************




More information about the vlc-devel mailing list