Only cleanup Threads when the try_join was successful
This commit is contained in:
parent
704b8d0277
commit
a45efd8a72
1 changed files with 6 additions and 2 deletions
|
@ -68,8 +68,12 @@ XboxdrvDaemon::cleanup_threads()
|
|||
{
|
||||
if (i->thread)
|
||||
{
|
||||
i->thread->try_join_thread();
|
||||
count += 1;
|
||||
if (i->thread->try_join_thread())
|
||||
{
|
||||
delete i->thread;
|
||||
i->thread = 0;
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue