Commit 551c941b authored by Cebtenzzre's avatar Cebtenzzre Committed by Max Kellermann

tag/Builder: don't ignore the result of tag_pool_dup_item

Also, use RemoveAll() instead of directly clearing TagBuilder::items in most cases, as its elements represent references that must be released. Closes #1023
parent 624c77ab
...@@ -6,6 +6,8 @@ ver 0.22.10 (not yet released) ...@@ -6,6 +6,8 @@ ver 0.22.10 (not yet released)
* input * input
- curl: fix crash bug after stream with Icy metadata was closed by peer - curl: fix crash bug after stream with Icy metadata was closed by peer
- tidal: remove defunct unmaintained plugin - tidal: remove defunct unmaintained plugin
* tags
- fix crash caused by bug in TagBuilder and a few potential reference leaks
ver 0.22.9 (2021/06/23) ver 0.22.9 (2021/06/23)
* database * database
......
...@@ -69,8 +69,8 @@ TagBuilder::operator=(const TagBuilder &other) noexcept ...@@ -69,8 +69,8 @@ TagBuilder::operator=(const TagBuilder &other) noexcept
/* increment the tag pool refcounters */ /* increment the tag pool refcounters */
const std::lock_guard<Mutex> protect(tag_pool_lock); const std::lock_guard<Mutex> protect(tag_pool_lock);
for (auto i : items) for (auto &i : items)
tag_pool_dup_item(i); i = tag_pool_dup_item(i);
return *this; return *this;
} }
...@@ -80,6 +80,8 @@ TagBuilder::operator=(TagBuilder &&other) noexcept ...@@ -80,6 +80,8 @@ TagBuilder::operator=(TagBuilder &&other) noexcept
{ {
duration = other.duration; duration = other.duration;
has_playlist = other.has_playlist; has_playlist = other.has_playlist;
RemoveAll();
items = std::move(other.items); items = std::move(other.items);
return *this; return *this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment