Changeset e4b683171493f44387766b6c8da57070065cf290

Show
Ignore:
Timestamp:
30/08/08 13:15:56 (3 months ago)
Author:
Rémi Denis-Courmont <rdenis@simphalempin.com>
git-committer:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1220094956 +0300
git-parent:

[0aee55f543790ba3230ef145707b0708e2c445f9]

git-author:
Rémi Denis-Courmont <rdenis@simphalempin.com> 1220094877 +0300
Message:

Resync object leak check

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/misc/objects.c

    r0aee55f re4b6831  
    306306    free( p_this->psz_header ); 
    307307 
     308#ifndef NDEBUG 
     309    if( VLC_OBJECT(p_this->p_libvlc) == p_this ) 
     310    { 
     311        /* Test for leaks */ 
     312        vlc_object_t *leaked = p_priv->next; 
     313        while( leaked != p_this ) 
     314        { 
     315            /* We are leaking this object */ 
     316            fprintf( stderr, 
     317                     "ERROR: leaking object (id:%i, type:%s, name:%s)\n", 
     318                     leaked->i_object_id, leaked->psz_object_type, 
     319                     leaked->psz_object_name ); 
     320            /* Dump object to ease debugging */ 
     321            vlc_object_dump( leaked ); 
     322            fflush(stderr); 
     323            leaked = vlc_internals (leaked)->next; 
     324        } 
     325 
     326        if( p_priv->next != p_this ) 
     327            /* Dump libvlc object to ease debugging */ 
     328            vlc_object_dump( p_this ); 
     329    } 
     330#endif 
     331 
    308332    if( p_this->p_libvlc == NULL ) 
    309     { 
    310 #ifndef NDEBUG 
    311         libvlc_global_data_t *p_global = (libvlc_global_data_t *)p_this; 
    312  
    313         assert( p_global == vlc_global() ); 
    314         /* Test for leaks */ 
    315         if (p_priv->next != p_this) 
    316         { 
    317             vlc_object_t *leaked = p_priv->next, *first = leaked; 
    318             do 
    319             { 
    320                 /* We are leaking this object */ 
    321                 fprintf( stderr, 
    322                          "ERROR: leaking object (id:%i, type:%s, name:%s)\n", 
    323                          leaked->i_object_id, leaked->psz_object_type, 
    324                          leaked->psz_object_name ); 
    325                 /* Dump libvlc object to ease debugging */ 
    326                 vlc_object_dump( leaked ); 
    327                 fflush(stderr); 
    328                 leaked = vlc_internals (leaked)->next; 
    329             } 
    330             while (leaked != first); 
    331  
    332             /* Dump global object to ease debugging */ 
    333             vlc_object_dump( p_this ); 
    334             /* Strongly abort, cause we want these to be fixed */ 
    335             abort(); 
    336         } 
    337 #endif 
    338  
    339333        /* We are the global object ... no need to lock. */ 
    340334        vlc_mutex_destroy( &structure_lock ); 
    341     } 
    342335 
    343336    FREENULL( p_this->psz_object_name );