summaryrefslogtreecommitdiffstats
path: root/libhb/common.c
diff options
context:
space:
mode:
authorsaintdev <[email protected]>2007-03-31 06:55:02 +0000
committersaintdev <[email protected]>2007-03-31 06:55:02 +0000
commit2338338511e4b1ef3ec5e85606900a846efa2b42 (patch)
treec33957efc6c20bd8a2cab6c30bbb689b3e5b88fd /libhb/common.c
parent18cd105e9a40beccc264178dba69b8b89926a121 (diff)
Fix about 156,199 bytes of leaked memory.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@469 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.c')
-rw-r--r--libhb/common.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/libhb/common.c b/libhb/common.c
index 1d66e0bcf..560a839e6 100644
--- a/libhb/common.c
+++ b/libhb/common.c
@@ -515,11 +515,30 @@ hb_title_t * hb_title_init( char * dvd, int index )
void hb_title_close( hb_title_t ** _t )
{
hb_title_t * t = *_t;
+ hb_audio_t * audio;
+ hb_chapter_t * chapter;
+ hb_subtitle_t * subtitle;
+ while( ( audio = hb_list_item( t->list_audio, 0 ) ) )
+ {
+ hb_list_rem( t->list_audio, audio );
+ free( audio );
+ }
hb_list_close( &t->list_audio );
+
+ while( ( chapter = hb_list_item( t->list_chapter, 0 ) ) )
+ {
+ hb_list_rem( t->list_chapter, chapter );
+ free( chapter );
+ }
hb_list_close( &t->list_chapter );
+
+ while( ( subtitle = hb_list_item( t->list_subtitle, 0 ) ) )
+ {
+ hb_list_rem( t->list_subtitle, subtitle );
+ free( subtitle );
+ }
hb_list_close( &t->list_subtitle );
- free( t->job );
free( t );
*_t = NULL;