tag/Pool: fix crash in tag_pool_put_item()
Regression by commit 76bdfabcc5
This commit is contained in:
parent
76bdfabcc5
commit
b896711fc6
|
@ -142,14 +142,17 @@ tag_pool_put_item(TagItem *item) noexcept
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto &list = tag_value_list(item->type, item->value);
|
auto &list = tag_value_list(item->type, item->value);
|
||||||
for (auto i = list.before_begin(), n = std::next(i);; i = n) {
|
for (auto i = list.before_begin();;) {
|
||||||
assert(n != list.end());
|
const auto n = std::next(i);
|
||||||
auto &s = *n++;
|
auto &s = *n;
|
||||||
|
assert(i != list.end());
|
||||||
|
|
||||||
if (&s == slot) {
|
if (&s == slot) {
|
||||||
list.erase_after(i);
|
list.erase_after(i);
|
||||||
DeleteVarSize(slot);
|
DeleteVarSize(slot);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i = n;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue