Skip to content

Commit

Permalink
Inventory: Don't throw resize lock exception in destructor (#13894)
Browse files Browse the repository at this point in the history
... of nodemeta inventories.
  • Loading branch information
Desour committed Oct 22, 2023
1 parent 341e53f commit 7e8831a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/nodemetadata.cpp
Expand Up @@ -225,8 +225,13 @@ void NodeMetadataList::remove(v3s16 p)
{
NodeMetadata *olddata = get(p);
if (olddata) {
if (m_is_metadata_owner)
if (m_is_metadata_owner) {
// clearing can throw an exception due to the invlist resize lock,
// which we don't want to happen in the noexcept destructor
// => call clear before
olddata->clear();
delete olddata;
}
m_data.erase(p);
}
}
Expand Down

0 comments on commit 7e8831a

Please sign in to comment.