From f62bfd1d2caf5f12ab1b9e2401c5689779d7ab83 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Mon, 13 Jun 2011 18:16:20 +0200 Subject: [PATCH] avoid to call AmThread::on_stop() when the thread is already stopped. --- core/AmThread.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/AmThread.cpp b/core/AmThread.cpp index ad08f7d6..887963e5 100644 --- a/core/AmThread.cpp +++ b/core/AmThread.cpp @@ -143,6 +143,11 @@ void AmThread::stop() { _m_td.lock(); + if(is_stopped()){ + _m_td.unlock(); + return; + } + // gives the thread a chance to clean up DBG("Thread %lu (%lu) calling on_stop, give it a chance to clean up.\n", (unsigned long int) _pid, (unsigned long int) _td);