diff options
author | Mark D. Roth <roth@google.com> | 2016-10-31 14:42:22 -0700 |
---|---|---|
committer | Mark D. Roth <roth@google.com> | 2016-10-31 14:42:22 -0700 |
commit | 3f265857f41c88ef7c7d7a8f1ace89a1a3f839ba (patch) | |
tree | 47d2f04da5a77ceedbaf4c02c4fb045426a4801a /test/cpp/end2end | |
parent | 6df607591ce42eee46538726432960e03f6db85d (diff) |
Fix memory leak.
Diffstat (limited to 'test/cpp/end2end')
-rw-r--r-- | test/cpp/end2end/round_robin_end2end_test.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/cpp/end2end/round_robin_end2end_test.cc b/test/cpp/end2end/round_robin_end2end_test.cc index f4ca3baa54..796b01cd4a 100644 --- a/test/cpp/end2end/round_robin_end2end_test.cc +++ b/test/cpp/end2end/round_robin_end2end_test.cc @@ -130,15 +130,15 @@ class RoundRobinEnd2endTest : public ::testing::Test { int port_; std::unique_ptr<Server> server_; MyTestServiceImpl service_; - std::thread* thread_; + std::unique_ptr<std::thread> thread_; explicit ServerData(const grpc::string& server_host) { port_ = grpc_pick_unused_port_or_die(); gpr_log(GPR_INFO, "starting server on port %d", port_); std::mutex mu; std::condition_variable cond; - thread_ = new std::thread( - std::bind(&ServerData::Start, this, server_host, &mu, &cond)); + thread_.reset(new std::thread( + std::bind(&ServerData::Start, this, server_host, &mu, &cond))); unique_lock<mutex> lock(mu); cond.wait(lock); gpr_log(GPR_INFO, "server startup complete"); |