Skip to content

Commit

Permalink
fix(Vfs): remove existing child nodes before creating a new one
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Mar 9, 2024
1 parent 5eb44c8 commit 2b5aa9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Vfs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ namespace zenkit {
}

VfsNode* VfsNode::create(VfsNode node) {
this->remove(node.name());

auto& children = std::get<ChildContainer>(_m_data);
auto it = children.insert(std::move(node));
return const_cast<VfsNode*>(&*it.first);
Expand Down

0 comments on commit 2b5aa9e

Please sign in to comment.