You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by "levy5307 (via GitHub)" <gi...@apache.org> on 2023/05/18 06:31:43 UTC

[GitHub] [incubator-pegasus] levy5307 commented on a diff in pull request #1480: refactor: remove some useless code

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


##########
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:
   could you change tye type of `_replica_stub` to `unique_ptr<replica_stub>`?



-- 
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-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org