Tag: destructor calls Clear()
Eliminate duplicate code.
This commit is contained in:
parent
4ab586aaf1
commit
d694150372
@ -74,16 +74,6 @@ Tag::Clear()
|
|||||||
num_items = 0;
|
num_items = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Tag::~Tag()
|
|
||||||
{
|
|
||||||
tag_pool_lock.lock();
|
|
||||||
for (int i = num_items; --i >= 0; )
|
|
||||||
tag_pool_put_item(items[i]);
|
|
||||||
tag_pool_lock.unlock();
|
|
||||||
|
|
||||||
delete[] items;
|
|
||||||
}
|
|
||||||
|
|
||||||
Tag::Tag(const Tag &other)
|
Tag::Tag(const Tag &other)
|
||||||
:time(other.time), has_playlist(other.has_playlist),
|
:time(other.time), has_playlist(other.has_playlist),
|
||||||
items(nullptr),
|
items(nullptr),
|
||||||
|
@ -71,7 +71,9 @@ struct Tag {
|
|||||||
/**
|
/**
|
||||||
* Free the tag object and all its items.
|
* Free the tag object and all its items.
|
||||||
*/
|
*/
|
||||||
~Tag();
|
~Tag() {
|
||||||
|
Clear();
|
||||||
|
}
|
||||||
|
|
||||||
Tag &operator=(const Tag &other) = delete;
|
Tag &operator=(const Tag &other) = delete;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user