diff --git a/libretroshare/src/util/rsthreads.cc b/libretroshare/src/util/rsthreads.cc index 297629a43..ceaf57368 100644 --- a/libretroshare/src/util/rsthreads.cc +++ b/libretroshare/src/util/rsthreads.cc @@ -103,6 +103,16 @@ RsThread::RsThread() mShouldStopSemaphore.set(0) ; } +RsThread::~RsThread() +{ + if(isRunning()) + { + std::cerr << "(EE) Deleting a thread that is actually running! Something is very wrong here:" << std::endl; + + print_stacktrace(); + } +} + bool RsThread::isRunning() { // do we need a mutex for this ? diff --git a/libretroshare/src/util/rsthreads.h b/libretroshare/src/util/rsthreads.h index d9c82792a..15c776e64 100644 --- a/libretroshare/src/util/rsthreads.h +++ b/libretroshare/src/util/rsthreads.h @@ -243,7 +243,7 @@ class RsThread { public: RsThread(); - virtual ~RsThread() {} + virtual ~RsThread() ; void start(const std::string &threadName = "");