Fix memory leak.

pull/8523/head
Mark D. Roth 8 years ago
parent 6df607591c
commit 3f265857f4
  1. 6
      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");

Loading…
Cancel
Save