yanglimingcn commented on code in PR #2872: URL: https://github.com/apache/brpc/pull/2872#discussion_r1926249705
########## src/brpc/server.cpp: ########## @@ -813,14 +863,26 @@ int Server::StartInternal(const butil::EndPoint& endpoint, } return -1; } + if (opt) { - _options = *opt; + copy_server_option(_options, *opt); } else { + // Don't forget to release `rpc_pb_message_factory` before overwriting `_options` + delete _options.rpc_pb_message_factory; + _options.rpc_pb_message_factory = NULL; + // Always reset to default options explicitly since `_options' // may be the options for the last run or even bad options _options = ServerOptions(); } + // Create the resource if: Review Comment: 这个逻辑也放到copy_server_options是否合理呢?看上去无论是构造,还是后期的设置,rpc_pb_message_factory都是必须不能为空的。 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org