Changeset 4f86b958a07865f443eef419a6e609f75568492a

Show
Ignore:
Timestamp:
01/15/06 23:10:41 (3 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1137363041 +0000
git-parent:

[348c8741c3f99e9492f69db912e70599e55e116b]

git-author:
Clément Stenac <zorglub@videolan.org> 1137363041 +0000
Message:

Fix some memleaks

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_messages.h

    r1856ddb r4f86b95  
    244244}; 
    245245 
     246VLC_EXPORT( void, stats_HandlerDestroy, (stats_handler_t*) ); 
     247 
    246248#define stats_Update( a,b,c) __stats_Update( VLC_OBJECT( a ), b, c ) 
    247249VLC_EXPORT( int, __stats_Update, (vlc_object_t*, char *, vlc_value_t) ); 
  • include/vlc_symbols.h

    r1856ddb r4f86b95  
    329329int playlist_Add (playlist_t *, const char *, const char *, int, int); 
    330330char * sout_CfgCreate (char **, sout_cfg_t **, char *); 
     331void stats_HandlerDestroy (stats_handler_t*); 
    331332osd_menu_t * __osd_MenuCreate (vlc_object_t *, const char *); 
    332333void * vlc_opendir (const char *); 
     
    886887    counter_t* (*__stats_CounterGet_inner) (vlc_object_t*, int, char *); 
    887888    input_thread_t * (*__input_CreateThread2_inner) (vlc_object_t *, input_item_t *, char *); 
     889    void (*stats_HandlerDestroy_inner) (stats_handler_t*); 
    888890}; 
    889891#  if defined (__PLUGIN__) 
     
    13141316#  define __stats_CounterGet (p_symbols)->__stats_CounterGet_inner 
    13151317#  define __input_CreateThread2 (p_symbols)->__input_CreateThread2_inner 
     1318#  define stats_HandlerDestroy (p_symbols)->stats_HandlerDestroy_inner 
    13161319#  elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__) 
    13171320/****************************************************************** 
     
    17451748    ((p_symbols)->__stats_CounterGet_inner) = __stats_CounterGet; \ 
    17461749    ((p_symbols)->__input_CreateThread2_inner) = __input_CreateThread2; \ 
     1750    ((p_symbols)->stats_HandlerDestroy_inner) = stats_HandlerDestroy; \ 
    17471751    (p_symbols)->net_ConvertIPv4_deprecated = NULL; \ 
    17481752 
  • src/libvlc.c

    r5827c89 r4f86b95  
    962962    while( ( p_stats = vlc_object_find( p_vlc, VLC_OBJECT_STATS, FIND_CHILD) )) 
    963963    { 
     964        stats_HandlerDestroy( p_stats ); 
    964965        vlc_object_detach( (vlc_object_t*) p_stats ); 
    965966        vlc_object_release( (vlc_object_t *)p_stats ); 
  • src/misc/stats.c

    r72e28ab r4f86b95  
    4646 
    4747/** 
     48 * Cleanup statistics handler stuff 
     49 * \param p_stats the handler to clean 
     50 * \return nothing 
     51 */ 
     52void stats_HandlerDestroy( stats_handler_t *p_stats ) 
     53{ 
     54    int i; 
     55    for ( i =  p_stats->i_counters - 1 ; i >= 0 ; i-- ) 
     56    { 
     57        int j; 
     58        counter * p_counter = p_stats->pp_counters[i]; 
     59 
     60        for( j = p_counter->i_samples -1; j >= 0 ; j-- ) 
     61        { 
     62            counter_sample_t *p_sample = p_counter->pp_samples[j]; 
     63            if( p_sample->val.psz_string ) 
     64                free( p_sample->val.psz_string ); 
     65            REMOVE_ELEM( p_counter->pp_samples, p_counter->i_samples, j ); 
     66            free( p_sample ); 
     67        } 
     68        free( p_counter->psz_name ); 
     69        REMOVE_ELEM( p_stats->pp_counters, p_stats->i_counter, i ); 
     70        free( p_counter ); 
     71    } 
     72} 
     73 
     74/** 
    4875 * Create a statistics counter 
    4976 * \param p_this the object for which to create the counter 
  • src/misc/vlm.c

    r1856ddb r4f86b95  
    11071107            } 
    11081108            free( psz_output ); 
     1109            free( psz_header ); 
    11091110 
    11101111            if( media->psz_mux ) 
     
    12091210            if( p_instance->psz_name ) free( p_instance->psz_name ); 
    12101211        } 
     1212        free( psz_header ); 
    12111213 
    12121214        return VLC_SUCCESS;