acelyc111 commented on code in PR #1480:
URL: 
https://github.com/apache/incubator-pegasus/pull/1480#discussion_r1197468996


##########
src/server/test/pegasus_server_test_base.h:
##########
@@ -77,14 +76,14 @@ class pegasus_server_test_base : public ::testing::Test
         // do not clear state
         _server->stop(false);
 
-        dsn::replication::destroy_replica_stub(_replica_stub);
-        dsn::replication::destroy_replica(_replica);
+        delete _replica_stub;
+        delete _replica;
     }
 
 protected:
     std::unique_ptr<mock_pegasus_server_impl> _server;
-    dsn::replication::replica *_replica;
-    dsn::replication::replica_stub *_replica_stub;
+    dsn::replication::replica *_replica = nullptr;
+    dsn::replication::replica_stub *_replica_stub = nullptr;

Review Comment:
   Good idea, but it will introduce more code changes if using unique_ptr. 
std::unique_ptr is not able to access the class replica's private constructor 
member.
   Because this is a patch to "remove codes", so we can do it in another PR.



-- 
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