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
This commit is contained in:
Dmitri Smirnov 2018-02-26 13:44:25 -08:00 committed by Facebook Github Bot
parent dfbe52e099
commit 7eb292da14
1 changed files with 0 additions and 1 deletions

View File

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