diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-10-04 21:01:17 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-04 21:01:19 -0700 |
commit | 1533279fb18b2b0f53345f0e0727d2f0f968c00d (patch) | |
tree | f3f52d6360f884bceaa2715fcf95e6326a59ed56 /src/tag.c | |
parent | 3e0c1bcf6237f42506cd0d74046e74a70fff0cb7 (diff) | |
parent | b84bf082df6ec5a7223c86abb94d799569aed1c1 (diff) | |
download | mpd-1533279fb18b2b0f53345f0e0727d2f0f968c00d.tar.gz mpd-1533279fb18b2b0f53345f0e0727d2f0f968c00d.tar.xz mpd-1533279fb18b2b0f53345f0e0727d2f0f968c00d.zip |
Merge commit 'box/song-locks' into ew/song-locks
* commit 'box/song-locks-wip':
directory: reuse existing directory if found on update
song: better handling of existing songs when rereading DB
tag: merge clearMpdTag into tag_free
song: start avoiding race in updateSongInfo
Diffstat (limited to '')
-rw-r--r-- | src/tag.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -296,12 +296,12 @@ void tag_clear_items_by_type(struct mpd_tag *tag, enum tag_type type) } } -static void clearMpdTag(struct mpd_tag *tag) +void tag_free(struct mpd_tag *tag) { int i; pthread_mutex_lock(&tag_pool_lock); - for (i = 0; i < tag->numOfItems; i++) + for (i = tag->numOfItems; --i >= 0; ) tag_pool_put_item(tag->items[i]); pthread_mutex_unlock(&tag_pool_lock); @@ -314,16 +314,6 @@ static void clearMpdTag(struct mpd_tag *tag) free(tag->items); } - tag->items = NULL; - - tag->numOfItems = 0; - - tag->time = -1; -} - -void tag_free(struct mpd_tag *tag) -{ - clearMpdTag(tag); free(tag); } |