]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
Hack to get the leaked object tree back
[vlc] / src / libvlc.c
index e9499963bed2a03977e0d40325f8107f6d04037a..f90994d435b3372c63eceff3fb83fb83053b94aa 100644 (file)
@@ -1134,6 +1134,12 @@ void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
     vlc_mutex_destroy( &priv->config_lock );
     vlc_mutex_destroy( &priv->timer_lock );
 
+#ifndef NDEBUG /* Hack to dump leaked objects tree */
+    if( vlc_internals( p_libvlc )->i_refcount > 1 )
+        while( vlc_internals( p_libvlc )->i_refcount > 0 )
+            vlc_object_release( p_libvlc );
+#endif
+
     assert( vlc_internals( p_libvlc )->i_refcount == 1 );
     vlc_object_release( p_libvlc );
 }