summaryrefslogtreecommitdiff
path: root/plugins/mpgmad
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-02-11 21:38:39 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-02-11 21:38:39 +0100
commit4adbda3bfc21c32f8447eae3a70b545791bb958f (patch)
tree05a4709563deed8a5919597366772ee02d4b644c /plugins/mpgmad
parent06698504cafb9d3b87674c51bbd49dbbb6a54db0 (diff)
fixed part of memory leaks
Diffstat (limited to 'plugins/mpgmad')
-rw-r--r--plugins/mpgmad/mpgmad.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c
index 9a925304..df68ba12 100644
--- a/plugins/mpgmad/mpgmad.c
+++ b/plugins/mpgmad/mpgmad.c
@@ -556,6 +556,7 @@ cmp3_init (DB_playItem_t *it) {
if (!info->buffer.file) {
return NULL;
}
+ deadbeef->pl_item_ref (it);
info->buffer.it = it;
info->info.readpos = 0;
if (!info->buffer.file->vfs->streaming) {
@@ -907,6 +908,9 @@ static void
cmp3_free (DB_fileinfo_t *_info) {
mpgmad_info_t *info = (mpgmad_info_t *)_info;
if (info->buffer.file) {
+ if (info->buffer.it) {
+ deadbeef->pl_item_unref (info->buffer.it);
+ }
deadbeef->fclose (info->buffer.file);
info->buffer.file = NULL;
mad_synth_finish (&info->synth);