[wpiutil] DynamicStruct: Clear nested fields when updating/adding a schema (#7334)

This commit is contained in:
Ryan Blue
2024-11-05 11:48:24 -05:00
committed by GitHub
parent 043c155087
commit 3fd33b1f72

View File

@@ -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) {