[vlc-commits] libvlc: add leak debugging code

Steve Lhomme git at videolan.org
Thu Mar 14 11:13:45 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Mar 12 09:10:24 2019 +0100| [496001e6a204ce25a611163ed95e4b6721657bfe] | committer: Steve Lhomme

libvlc: add leak debugging code

disabled by default

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

 src/libvlc.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/libvlc.c b/src/libvlc.c
index 8200f81d9e..a140aa3c00 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -450,6 +450,16 @@ void libvlc_InternalDestroy( libvlc_int_t *p_libvlc )
 
     vlc_ExitDestroy( &priv->exit );
 
+#if 0
+    {
+        vlc_object_internals_t *internal = vlc_internals(p_libvlc);
+        if (atomic_load(&internal->refs) != 1)
+        {
+            fprintf(stderr, "=== vlc_object LEAKS detected ===\n");
+            DumpStructureLocked(VLC_OBJECT(p_libvlc), stderr, 0);
+        }
+    }
+#endif
     assert( atomic_load(&(vlc_internals(p_libvlc)->refs)) == 1 );
     vlc_object_delete(p_libvlc);
 }



More information about the vlc-commits mailing list