From 2ab4fcbc2400ac97bfacb91d9b4836c83a9c7f15 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Thu, 26 Oct 2023 19:17:29 -0700 Subject: [PATCH] [wpiutil] ProtobufMessageDatabase: Clear messages first (#5827) The message destructor appears to call something on the descriptor. --- .../src/main/native/cpp/protobuf/ProtobufMessageDatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wpiutil/src/main/native/cpp/protobuf/ProtobufMessageDatabase.cpp b/wpiutil/src/main/native/cpp/protobuf/ProtobufMessageDatabase.cpp index 303bf9d30a..7bf529fe52 100644 --- a/wpiutil/src/main/native/cpp/protobuf/ProtobufMessageDatabase.cpp +++ b/wpiutil/src/main/native/cpp/protobuf/ProtobufMessageDatabase.cpp @@ -18,8 +18,8 @@ bool ProtobufMessageDatabase::Add(std::string_view filename, if (file.complete) { file.complete = false; - m_factory.reset(); m_msgs.clear(); + m_factory.reset(); // rebuild the pool EXCEPT for this descriptor m_pool = std::make_unique();