Commit debed14a authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix infinite loop

parent 6d9fde80
...@@ -339,9 +339,10 @@ static void vlc_object_destroy( vlc_object_t *p_this ) ...@@ -339,9 +339,10 @@ static void vlc_object_destroy( vlc_object_t *p_this )
#ifndef NDEBUG #ifndef NDEBUG
assert( p_global == vlc_global() ); assert( p_global == vlc_global() );
/* Test for leaks */ /* Test for leaks */
for( vlc_object_t *leaked = p_priv->next; if (p_priv->next != p_this)
leaked != p_this; {
leaked = vlc_internals (leaked)->next ) vlc_object_t *leaked = p_priv->next, *first = leaked;
do
{ {
/* We are leaking this object */ /* We are leaking this object */
fprintf( stderr, fprintf( stderr,
...@@ -351,11 +352,11 @@ static void vlc_object_destroy( vlc_object_t *p_this ) ...@@ -351,11 +352,11 @@ static void vlc_object_destroy( vlc_object_t *p_this )
/* Dump libvlc object to ease debugging */ /* Dump libvlc object to ease debugging */
vlc_object_dump( leaked ); vlc_object_dump( leaked );
fflush(stderr); fflush(stderr);
leaked = vlc_internals (leaked)->next;
} }
while (leaked != first);
if( p_priv->next != p_this ) /* Dump global object to ease debugging */
{
/* Dump libvlc object to ease debugging */
vlc_object_dump( p_this ); vlc_object_dump( p_this );
/* Strongly abort, cause we want these to be fixed */ /* Strongly abort, cause we want these to be fixed */
abort(); abort();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment