summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGavin Hurlbut <ghurlbut@mythtv.org>2011-01-23 08:49:06 (GMT)
committer Gavin Hurlbut <ghurlbut@mythtv.org>2011-02-02 21:55:56 (GMT)
commit51e34863f2c3b62da469c27a10e259fc80fe91b9 (patch)
tree613aafd7f0a308650b8105af3bdd9d7e29bbbfe3
parentcd0acb0504edae530e2e93e5b05bef4487fa414c (diff)
Change ThreadPool shutdown to use deleteLater
This is to fix #9500, which has the frontend segfaulting on shutdown. This code will hopefully all be overhauled in the awaited webserver rewrite, but in the mean time, let's have it behaving. I also moved the order of removing from the deque and marking it for deletion, as I was toying with different locking methods. (cherry picked from commit 255a074b19a9c72ee91a6028efe195d723854cf8)
-rw-r--r--mythtv/libs/libmythupnp/threadpool.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/mythtv/libs/libmythupnp/threadpool.cpp b/mythtv/libs/libmythupnp/threadpool.cpp
index 9059dc1..8badd16 100644
--- a/mythtv/libs/libmythupnp/threadpool.cpp
+++ b/mythtv/libs/libmythupnp/threadpool.cpp
@@ -326,14 +326,11 @@ ThreadPool::~ThreadPool( )
while (it != m_lstThreads.end() )
{
WorkerThread *pThread = *it;
-
- if (pThread != NULL)
- delete pThread;
-
it = m_lstThreads.erase( it );
- }
-
+ if (pThread != NULL)
+ pThread->deleteLater();
+ }
}
/////////////////////////////////////////////////////////////////////////////