diff options
author | 2010-04-03 13:14:41 +0200 | |
---|---|---|
committer | 2010-04-03 13:14:41 +0200 | |
commit | 3e27fc0b8f694cc3ce121cdf152b6b1ff8943f04 (patch) | |
tree | 40e2f04406a723aeee61a4929fb490bf7e0a9bb9 /streamer.c | |
parent | 16b16e1e6cd83fd4c518408b610f3ef176f0f443 (diff) |
fixed several memleaks
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 20 |
1 files changed, 18 insertions, 2 deletions
@@ -37,8 +37,8 @@ #include "volume.h" #include "vfs.h" -//#define trace(...) { fprintf(stderr, __VA_ARGS__); } -#define trace(fmt,...) +#define trace(...) { fprintf(stderr, __VA_ARGS__); } +//#define trace(fmt,...) static intptr_t streamer_tid; static int src_quality; @@ -503,6 +503,9 @@ streamer_set_current (playItem_t *it) { else { mutex_lock (decodemutex); fileinfo = info; + if (streaming_track) { + pl_item_unref (streaming_track); + } streaming_track = it; pl_item_ref (streaming_track); mutex_unlock (decodemutex); @@ -928,6 +931,19 @@ streamer_free (void) { streaming_terminate = 1; thread_join (streamer_tid); mutex_free (decodemutex); + + if (streaming_track) { + pl_item_unref (streaming_track); + streaming_track = NULL; + } + if (playing_track) { + pl_item_unref (playing_track); + playing_track = NULL; + } + if (playlist_track) { + playlist_track = NULL; + } + decodemutex = 0; mutex_free (mutex); mutex = 0; |