From 76530e2c05f6c4f31f0484e91adffab69daa0f37 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 13 Mar 2017 19:13:37 +0100 Subject: [PATCH] try fix segfault with --enable-cleanup --- src/driver/streamts.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; }