Only cleanup Threads when the try_join was successful

This commit is contained in:
Ingo Ruhnke 2011-01-24 17:21:50 +01:00
parent 704b8d0277
commit a45efd8a72

View file

@ -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;
}
}
}