Changeset 4f86b958a07865f443eef419a6e609f75568492a
- 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
| r1856ddb |
r4f86b95 |
|
| 244 | 244 | }; |
|---|
| 245 | 245 | |
|---|
| | 246 | VLC_EXPORT( void, stats_HandlerDestroy, (stats_handler_t*) ); |
|---|
| | 247 | |
|---|
| 246 | 248 | #define stats_Update( a,b,c) __stats_Update( VLC_OBJECT( a ), b, c ) |
|---|
| 247 | 249 | VLC_EXPORT( int, __stats_Update, (vlc_object_t*, char *, vlc_value_t) ); |
|---|
| r1856ddb |
r4f86b95 |
|
| 329 | 329 | int playlist_Add (playlist_t *, const char *, const char *, int, int); |
|---|
| 330 | 330 | char * sout_CfgCreate (char **, sout_cfg_t **, char *); |
|---|
| | 331 | void stats_HandlerDestroy (stats_handler_t*); |
|---|
| 331 | 332 | osd_menu_t * __osd_MenuCreate (vlc_object_t *, const char *); |
|---|
| 332 | 333 | void * vlc_opendir (const char *); |
|---|
| … | … | |
| 886 | 887 | counter_t* (*__stats_CounterGet_inner) (vlc_object_t*, int, char *); |
|---|
| 887 | 888 | input_thread_t * (*__input_CreateThread2_inner) (vlc_object_t *, input_item_t *, char *); |
|---|
| | 889 | void (*stats_HandlerDestroy_inner) (stats_handler_t*); |
|---|
| 888 | 890 | }; |
|---|
| 889 | 891 | # if defined (__PLUGIN__) |
|---|
| … | … | |
| 1314 | 1316 | # define __stats_CounterGet (p_symbols)->__stats_CounterGet_inner |
|---|
| 1315 | 1317 | # define __input_CreateThread2 (p_symbols)->__input_CreateThread2_inner |
|---|
| | 1318 | # define stats_HandlerDestroy (p_symbols)->stats_HandlerDestroy_inner |
|---|
| 1316 | 1319 | # elif defined (HAVE_DYNAMIC_PLUGINS) && !defined (__BUILTIN__) |
|---|
| 1317 | 1320 | /****************************************************************** |
|---|
| … | … | |
| 1745 | 1748 | ((p_symbols)->__stats_CounterGet_inner) = __stats_CounterGet; \ |
|---|
| 1746 | 1749 | ((p_symbols)->__input_CreateThread2_inner) = __input_CreateThread2; \ |
|---|
| | 1750 | ((p_symbols)->stats_HandlerDestroy_inner) = stats_HandlerDestroy; \ |
|---|
| 1747 | 1751 | (p_symbols)->net_ConvertIPv4_deprecated = NULL; \ |
|---|
| 1748 | 1752 | |
|---|
| r5827c89 |
r4f86b95 |
|
| 962 | 962 | while( ( p_stats = vlc_object_find( p_vlc, VLC_OBJECT_STATS, FIND_CHILD) )) |
|---|
| 963 | 963 | { |
|---|
| | 964 | stats_HandlerDestroy( p_stats ); |
|---|
| 964 | 965 | vlc_object_detach( (vlc_object_t*) p_stats ); |
|---|
| 965 | 966 | vlc_object_release( (vlc_object_t *)p_stats ); |
|---|
| r72e28ab |
r4f86b95 |
|
| 46 | 46 | |
|---|
| 47 | 47 | /** |
|---|
| | 48 | * Cleanup statistics handler stuff |
|---|
| | 49 | * \param p_stats the handler to clean |
|---|
| | 50 | * \return nothing |
|---|
| | 51 | */ |
|---|
| | 52 | void 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 | /** |
|---|
| 48 | 75 | * Create a statistics counter |
|---|
| 49 | 76 | * \param p_this the object for which to create the counter |
|---|
| r1856ddb |
r4f86b95 |
|
| 1107 | 1107 | } |
|---|
| 1108 | 1108 | free( psz_output ); |
|---|
| | 1109 | free( psz_header ); |
|---|
| 1109 | 1110 | |
|---|
| 1110 | 1111 | if( media->psz_mux ) |
|---|
| … | … | |
| 1209 | 1210 | if( p_instance->psz_name ) free( p_instance->psz_name ); |
|---|
| 1210 | 1211 | } |
|---|
| | 1212 | free( psz_header ); |
|---|
| 1211 | 1213 | |
|---|
| 1212 | 1214 | return VLC_SUCCESS; |
|---|