Merge branch 'v0.23.x'

This commit is contained in:
Max Kellermann
2023-01-06 08:12:38 +01:00
6 changed files with 22 additions and 10 deletions

View File

@@ -261,8 +261,14 @@ TagBuilder::RemoveAll() noexcept
void
TagBuilder::RemoveType(TagType type) noexcept
{
if (items.empty())
/* don't acquire the tag_pool_lock if we're not going
to call tag_pool_put_item() anyway */
return;
const auto begin = items.begin(), end = items.end();
const std::scoped_lock<Mutex> protect(tag_pool_lock);
items.erase(std::remove_if(begin, end,
[type](TagItem *item) {
if (item->type != type)