levy5307 commented on a change in pull request #685:
URL: https://github.com/apache/incubator-pegasus/pull/685#discussion_r560854660



##########
File path: src/server/test/pegasus_server_write_test.cpp
##########
@@ -60,19 +60,18 @@ class pegasus_server_write_test : public 
pegasus_server_test_base
                 int put_rpc_cnt = dsn::rand::next_u32(1, 10);
                 int remove_rpc_cnt = dsn::rand::next_u32(1, 10);
                 int total_rpc_cnt = put_rpc_cnt + remove_rpc_cnt;
-                auto writes = new dsn::message_ex *[total_rpc_cnt];
+                /**
+                 * writes[0] ~ writes[total_rpc_cnt-1] will be destructed by 
their corresponding
+                 * rpc_holders, which created in on_batched_write_requests. So 
we don't need to
+                 * release them here
+                 **/
+                dsn::message_ex *writes[total_rpc_cnt];
                 for (int i = 0; i < put_rpc_cnt; i++) {
                     writes[i] = pegasus::create_put_request(req);
                 }
                 for (int i = put_rpc_cnt; i < total_rpc_cnt; i++) {
                     writes[i] = pegasus::create_remove_request(key);
                 }
-                auto cleanup = dsn::defer([=]() {

Review comment:
       Done




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

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