try fix segfault with --enable-cleanup

Origin commit data
------------------
Commit: 76530e2c05
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2017-03-13 (Mon, 13 Mar 2017)
This commit is contained in:
Jacek Jendrzej
2017-03-13 19:13:37 +01:00
parent aaede62c71
commit 8a9fcfeb55

View File

@@ -264,8 +264,11 @@ bool CStreamManager::Stop()
if (!running)
return false;
running = false;
cancel();
bool ret = (OpenThreads::Thread::join() == 0);
bool ret = false;
if (OpenThreads::Thread::CurrentThread() == this) {
cancel();
ret = (OpenThreads::Thread::join() == 0);
}
StopAll();
return ret;
}