diff --git a/wpiutil/src/main/native/cpp/struct/DynamicStruct.cpp b/wpiutil/src/main/native/cpp/struct/DynamicStruct.cpp index 28e61dacd1..120590d5f4 100644 --- a/wpiutil/src/main/native/cpp/struct/DynamicStruct.cpp +++ b/wpiutil/src/main/native/cpp/struct/DynamicStruct.cpp @@ -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) {