Always close the thread handle in the destructor.

This commit is contained in:
chris 2004-04-15 03:04:46 +00:00
parent a0aeb885eb
commit 9999eb0f9c

View File

@ -44,11 +44,16 @@ public:
asio_detail_win_thread_function, arg, 0, &thread_id));
}
// Destructor.
~win_thread()
{
::CloseHandle(thread_);
}
// Wait for the thread to exit.
void join()
{
::WaitForSingleObject(thread_, INFINITE);
::CloseHandle(thread_);
}
private: