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-01-23 09:44:10 (GMT)
commit255a074b19a9c72ee91a6028efe195d723854cf8 (patch)
tree9dabb515c074c043f5db4e2b94e93c432bd34a99
parentb34cf7d244446d8a434fcf923b3402cffeed36d9 (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.
-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();
+ }
}
/////////////////////////////////////////////////////////////////////////////