Skip to content

Commit

Permalink
Change ThreadPool shutdown to use deleteLater
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Beirdo committed Jan 23, 2011
1 parent b34cf7d commit 255a074
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mythtv/libs/libmythupnp/threadpool.cpp
Expand Up @@ -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();
}
}

/////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 255a074

Please sign in to comment.