提交 7eb292da 编写于 作者: D Dmitri Smirnov 提交者: Facebook Github Bot

Fix a memory leak in WindowsThread

Summary:
_endthreadex does not return and thus objects
  for stack destructors do not run. This creates a memory leak.
  We remove the calls since _enthreadex called automatically after the
  threadproc returns i.e. thread exits.
Closes https://github.com/facebook/rocksdb/pull/3542

Differential Revision: D7088713

Pulled By: ajkr

fbshipit-source-id: 749ecafc6a9572f587f76e516547e07734349a54
上级 dfbe52e0
......@@ -166,7 +166,6 @@ unsigned int __stdcall WindowsThread::Data::ThreadProc(void* arg) {
auto ptr = reinterpret_cast<std::shared_ptr<Data>*>(arg);
std::unique_ptr<std::shared_ptr<Data>> data(ptr);
(*data)->func_();
_endthreadex(0);
return 0;
}
} // namespace port
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册