revert fix for #2088 as it breaks testsuite

This commit is contained in:
Günter Obiltschnig 2018-03-05 22:13:30 +01:00
parent 38c9328db6
commit 4b50fee50b

View File

@ -96,7 +96,7 @@ void TCPServerDispatcher::release()
void TCPServerDispatcher::run() void TCPServerDispatcher::run()
{ {
AutoPtr<TCPServerDispatcher> guard(this, false); // ensure _rc is decreased when function exits AutoPtr<TCPServerDispatcher> guard(this, true); // ensure object stays alive
int idleTime = (int) _pParams->getThreadIdleTime().totalMilliseconds(); int idleTime = (int) _pParams->getThreadIdleTime().totalMilliseconds();
@ -149,10 +149,6 @@ void TCPServerDispatcher::enqueue(const StreamSocket& socket)
{ {
_threadPool.startWithPriority(_pParams->getThreadPriority(), *this, threadName); _threadPool.startWithPriority(_pParams->getThreadPriority(), *this, threadName);
++_currentThreads; ++_currentThreads;
// Ensure this object lives at least until run() starts
// Small chance of leaking if threadpool is stopped before this
// work runs, but better than a dangling pointer and crash!
duplicate();
} }
catch (Poco::Exception&) catch (Poco::Exception&)
{ {