aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/util/proto_file_parser.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/cpp/util/proto_file_parser.cc')
-rw-r--r--test/cpp/util/proto_file_parser.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/cpp/util/proto_file_parser.cc b/test/cpp/util/proto_file_parser.cc
index 9f1f05595e..d501c3697b 100644
--- a/test/cpp/util/proto_file_parser.cc
+++ b/test/cpp/util/proto_file_parser.cc
@@ -81,8 +81,9 @@ class ErrorPrinter : public protobuf::compiler::MultiFileErrorCollector {
ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
const grpc::string& proto_path,
const grpc::string& protofiles)
- : has_error_(false) {
- std::vector<grpc::string> service_list;
+ : has_error_(false),
+ dynamic_factory_(new protobuf::DynamicMessageFactory()) {
+ std::vector<std::string> service_list;
if (channel) {
reflection_db_.reset(new grpc::ProtoReflectionDescriptorDatabase(channel));
reflection_db_->GetServices(&service_list);
@@ -127,7 +128,6 @@ ProtoFileParser::ProtoFileParser(std::shared_ptr<grpc::Channel> channel,
}
desc_pool_.reset(new protobuf::DescriptorPool(desc_db_.get()));
- dynamic_factory_.reset(new protobuf::DynamicMessageFactory(desc_pool_.get()));
for (auto it = service_list.begin(); it != service_list.end(); it++) {
if (known_services.find(*it) == known_services.end()) {