[vlc-devel] commit: Destroy/cleanup should be consistent with Create/Init ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat Jan 17 21:16:19 CET 2009


vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Sat Jan 17 22:14:51 2009 +0200| [6858023f094eb63c54607ad27b8f3e8a36a1e26d] | committer: Rémi Denis-Courmont 

Destroy/cleanup should be consistent with Create/Init

Otherwise, the Create/Destroy sequence crashes.

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

 src/libvlc.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/libvlc.c b/src/libvlc.c
index 93ef9fc..8ae8005 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -1071,18 +1071,6 @@ void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
     msg_Dbg( p_libvlc, "removing stats" );
     vlc_mutex_destroy( &p_libvlc->p_stats->lock );
     FREENULL( p_libvlc->p_stats );
-}
-
-/**
- * Destroy everything.
- * This function requests the running threads to finish, waits for their
- * termination, and destroys their structure.
- * It stops the thread systems: no instance can run after this has run
- * \param p_libvlc the instance to destroy
- */
-void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
-{
-    libvlc_priv_t *priv = libvlc_priv( p_libvlc );
 
 #ifndef WIN32
     char* psz_pidfile = NULL;
@@ -1116,6 +1104,18 @@ void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
     var_DelCallback( p_libvlc, "key-pressed", vlc_key_to_action,
                      p_libvlc->p_hotkeys );
     FREENULL( p_libvlc->p_hotkeys );
+}
+
+/**
+ * Destroy everything.
+ * This function requests the running threads to finish, waits for their
+ * termination, and destroys their structure.
+ * It stops the thread systems: no instance can run after this has run
+ * \param p_libvlc the instance to destroy
+ */
+void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
+{
+    libvlc_priv_t *priv = libvlc_priv( p_libvlc );
 
     vlc_mutex_lock( &global_lock );
     i_instances--;




More information about the vlc-devel mailing list