Commit abb28593 authored by gd's avatar gd Committed by Max Kellermann

TagBuilder::RemoveType: added missing tag pool lock before call to tag_pool_put_item

parent 115693b0
ver 0.23.12 (not yet released)
* tags
- fix crash bug due to race condition
ver 0.23.11 (2022/11/28)
* database
......
......@@ -263,8 +263,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)
......
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