From 551c66e5c02ab59eb7665cfca40df622aaba34dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Fri, 22 Apr 2016 11:21:38 -0300 Subject: [PATCH] Small fix in Win32 ThreadImpl. --- src/eepp/system/platform/win/threadimpl.cpp | 7 +++++++ src/eepp/system/platform/win/threadimpl.hpp | 2 ++ 2 files changed, 9 insertions(+) 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();