Fix crash on Dextra unlink

master
Geoffrey Merck 4 years ago
parent 180b79ffa7
commit 929d5b4910

@ -76,15 +76,17 @@ void CDExtraProtocolHandlerPool::release(CDExtraProtocolHandler *handler)
assert(handler != NULL); assert(handler != NULL);
for (auto it=m_pool.begin(); it!=m_pool.end(); it++) { for (auto it=m_pool.begin(); it!=m_pool.end(); it++) {
if (it->second == handler) { if (it->second == handler) {
it->second->close();
delete it->second;
CLog::logInfo("Releasing CDExtraProtocolHandler on port %u.\n", it->first);
m_pool.erase(it); m_pool.erase(it);
handler->close();
delete handler;
m_index = m_pool.end(); // m_index might be out of order, reset it
CLog::logInfo("Releasing DExtra Protocol Handler on port %u.\n", it->first);
return; return;
} }
} }
// we should never get here! // we should never get here!
CLog::logInfo("ERROR: could not find CDExtraProtocolHander (port=%u) to release!\n", handler->getPort()); CLog::logInfo("ERROR: could not find DExtra Protocol Hander (port=%u) to release!\n", handler->getPort());
} }
DEXTRA_TYPE CDExtraProtocolHandlerPool::read() DEXTRA_TYPE CDExtraProtocolHandlerPool::read()

Loading…
Cancel
Save

Powered by TurnKey Linux.