diff --git a/src/eepp/system/platform/win/threadimpl.cpp b/src/eepp/system/platform/win/threadimpl.cpp index 9a5ecba8f..4497d2cd7 100644 --- a/src/eepp/system/platform/win/threadimpl.cpp +++ b/src/eepp/system/platform/win/threadimpl.cpp @@ -17,6 +17,13 @@ ThreadImpl::ThreadImpl( Thread * owner ) { std::cerr << "Failed to create thread" << std::endl; } +ThreadImpl::~ThreadImpl() +{ + if ( mThread ) { + CloseHandle( mThread ); + } +} + void ThreadImpl::Wait() { if ( mThread ) { // Wait for the thread to finish, no timeout diff --git a/src/eepp/system/platform/win/threadimpl.hpp b/src/eepp/system/platform/win/threadimpl.hpp index bfb0327da..228d5a5ed 100644 --- a/src/eepp/system/platform/win/threadimpl.hpp +++ b/src/eepp/system/platform/win/threadimpl.hpp @@ -21,6 +21,8 @@ class ThreadImpl { static UintPtr GetCurrentThreadId(); ThreadImpl( Thread * owner ); + + ~ThreadImpl(); void Wait();