Always close the thread handle in the destructor.
This commit is contained in:
parent
a0aeb885eb
commit
9999eb0f9c
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user