[vlc-devel] commit: Cleanup functions cannot fail ( 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:09:40 2009 +0200| [07fb0fb9551833df8a6ba9abac366f7281da00c0] | committer: Rémi Denis-Courmont 

Cleanup functions cannot fail

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

 src/control/libvlc_internal.h |    4 ++--
 src/libvlc.c                  |   12 ++----------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/control/libvlc_internal.h b/src/control/libvlc_internal.h
index 90fb7a8..a7520d2 100644
--- a/src/control/libvlc_internal.h
+++ b/src/control/libvlc_internal.h
@@ -41,8 +41,8 @@
  ***************************************************************************/
 VLC_EXPORT (libvlc_int_t *, libvlc_InternalCreate, ( void ) );
 VLC_EXPORT (int, libvlc_InternalInit, ( libvlc_int_t *, int, const char *ppsz_argv[] ) );
-VLC_EXPORT (int, libvlc_InternalCleanup, ( libvlc_int_t * ) );
-VLC_EXPORT (int, libvlc_InternalDestroy, ( libvlc_int_t * ) );
+VLC_EXPORT (void, libvlc_InternalCleanup, ( libvlc_int_t * ) );
+VLC_EXPORT (void, libvlc_InternalDestroy, ( libvlc_int_t * ) );
 
 VLC_EXPORT (int, libvlc_InternalAddIntf, ( libvlc_int_t *, const char * ) );
 
diff --git a/src/libvlc.c b/src/libvlc.c
index 6127966..93ef9fc 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -1020,7 +1020,7 @@ int libvlc_InternalInit( libvlc_int_t *p_libvlc, int i_argc,
  * Cleanup a libvlc instance. The instance is not completely deallocated
  * \param p_libvlc the instance to clean
  */
-int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
+void libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
 {
     libvlc_priv_t *priv = libvlc_priv (p_libvlc);
     playlist_t    *p_playlist = priv->p_playlist;
@@ -1071,8 +1071,6 @@ int 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 );
-
-    return VLC_SUCCESS;
 }
 
 /**
@@ -1082,11 +1080,8 @@ int libvlc_InternalCleanup( libvlc_int_t *p_libvlc )
  * It stops the thread systems: no instance can run after this has run
  * \param p_libvlc the instance to destroy
  */
-int libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
+void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
 {
-    if( !p_libvlc )
-        return VLC_EGENERIC;
-
     libvlc_priv_t *priv = libvlc_priv( p_libvlc );
 
 #ifndef WIN32
@@ -1139,9 +1134,6 @@ int libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
     vlc_mutex_destroy( &priv->timer_lock );
 
     vlc_object_release( p_libvlc );
-    p_libvlc = NULL;
-
-    return VLC_SUCCESS;
 }
 
 /**




More information about the vlc-devel mailing list