forked from mia/Aegisub
Should fix #521 - no more "can not wait for thread termination" / "couldn't terminate thread" errors.
Originally committed to SVN as r1491.
This commit is contained in:
parent
4ddc7d5820
commit
aff3548407
1 changed files with 4 additions and 2 deletions
|
@ -362,8 +362,10 @@ void DirectSoundPlayer::Play(__int64 start,__int64 count) {
|
|||
void DirectSoundPlayer::Stop(bool timerToo) {
|
||||
// Stop the thread
|
||||
if (thread) {
|
||||
thread->Stop();
|
||||
thread->Wait();
|
||||
if (thread->IsAlive()) {
|
||||
thread->Stop();
|
||||
thread->Wait();
|
||||
}
|
||||
thread = NULL;
|
||||
}
|
||||
// The thread is now guaranteed dead and there are no concurrency problems to worry about
|
||||
|
|
Loading…
Reference in a new issue