From 23c8ad859c4acbf133fd00ec65643fffa27754df Mon Sep 17 00:00:00 2001 From: Yu Yang Date: Tue, 24 Jan 2017 13:51:32 +0800 Subject: [PATCH] Make MyServer as a stack variable --- paddle/pserver/test/test_ProtoServer.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/paddle/pserver/test/test_ProtoServer.cpp b/paddle/pserver/test/test_ProtoServer.cpp index e70e1670d..04236fda2 100644 --- a/paddle/pserver/test/test_ProtoServer.cpp +++ b/paddle/pserver/test/test_ProtoServer.cpp @@ -161,15 +161,8 @@ TEST(ProtoServer, extended) { int main(int argc, char** argv) { paddle::initMain(argc, argv); testing::InitGoogleTest(&argc, argv); - - std::unique_ptr server; - if (FLAGS_rdma_tcp == "rdma") { - server.reset(new MyServer(FLAGS_port, 0)); - } else { - server.reset(new MyServer(FLAGS_port)); - } - - server->start(); + MyServer server(FLAGS_port, FLAGS_rdma_tcp == "rdma" ? 0 : -1); + server.start(); usleep(10000); return RUN_ALL_TESTS(); -- GitLab