mirror of
https://github.com/SFML/SFML.git
synced 2024-11-24 20:31:05 +08:00
Fixed Thread implementation not destroyed after Wait() or Terminate()
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1032 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
9a7fcc04be
commit
125daf062f
@ -70,11 +70,7 @@ myUserData (UserData)
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
Thread::~Thread()
|
Thread::~Thread()
|
||||||
{
|
{
|
||||||
// Wait for the thread to finish before destroying the instance
|
|
||||||
Wait();
|
Wait();
|
||||||
|
|
||||||
// Destroy the implementation
|
|
||||||
delete myThreadImpl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -94,7 +90,11 @@ void Thread::Launch()
|
|||||||
void Thread::Wait()
|
void Thread::Wait()
|
||||||
{
|
{
|
||||||
if (myThreadImpl)
|
if (myThreadImpl)
|
||||||
|
{
|
||||||
myThreadImpl->Wait();
|
myThreadImpl->Wait();
|
||||||
|
delete myThreadImpl;
|
||||||
|
myThreadImpl = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +107,11 @@ void Thread::Wait()
|
|||||||
void Thread::Terminate()
|
void Thread::Terminate()
|
||||||
{
|
{
|
||||||
if (myThreadImpl)
|
if (myThreadImpl)
|
||||||
|
{
|
||||||
myThreadImpl->Terminate();
|
myThreadImpl->Terminate();
|
||||||
|
delete myThreadImpl;
|
||||||
|
myThreadImpl = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user