diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index f69dcea08..50fb9bbba 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -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; }