Skip to content

Commit 95653aa

Browse files
committed
Use importer pool for DynamicMessageFactory
Construct the DynamicMessageFactory with the importer's DescriptorPool (d->importer->pool()) instead of the default pool. This ensures dynamically created protobuf messages use the same descriptor pool as the importer, preventing descriptor resolution issues when registering message types.
1 parent b407178 commit 95653aa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/MessageTypeStore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ bool Arcus::MessageTypeStore::registerAllMessageTypes(const std::string& file_na
179179

180180
if (! d->message_factory)
181181
{
182-
d->message_factory = std::make_shared<google::protobuf::DynamicMessageFactory>();
182+
d->message_factory = std::make_shared<google::protobuf::DynamicMessageFactory>(d->importer->pool());
183183
}
184184

185185
for (int i = 0; i < descriptor->message_type_count(); ++i)

0 commit comments

Comments
 (0)