Skip to content

Commit

Permalink
DynamicStruct: Clear nested fields when updating/adding a schema
Browse files Browse the repository at this point in the history
  • Loading branch information
rzblue committed Nov 4, 2024
1 parent c23559b commit 4f25d0e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wpiutil/src/main/native/cpp/struct/DynamicStruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ const StructDescriptor* StructDescriptorDatabase::Add(std::string_view name,
.first->second;
theStruct.m_schema = schema;
theStruct.m_fields.clear();
theStruct.m_fieldsByName.clear();
theStruct.m_fields.reserve(parsed.declarations.size());
bool isValid = true;
for (auto&& decl : parsed.declarations) {
Expand Down

0 comments on commit 4f25d0e

Please sign in to comment.