w-gc commented on code in PR #2872:
URL: https://github.com/apache/brpc/pull/2872#discussion_r1914516632


##########
src/brpc/server.cpp:
##########
@@ -813,12 +813,24 @@ int Server::StartInternal(const butil::EndPoint& endpoint,
         }
         return -1;
     }
-    if (opt) {
+
+    if (&_options == opt) {
+        // do nothing
+    } else if (opt) {
+        if (_options.rpc_pb_message_factory != opt->rpc_pb_message_factory) {
+            delete _options.rpc_pb_message_factory;
+            _options.rpc_pb_message_factory = NULL;
+        }

Review Comment:
   I modified this part so that it references the destructor, but I'm not sure 
of the specific lifetime of each pointer resource.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to