MXS-2612 Free routing worker local data

When a RoutingWorker is destructed, all existing local data will
unconditionally be destroyed.

The case in point is the vector<SFilterDef>s that are held as routing
worker local data by the Service. Unless the local data is deleted, the
filter defs will not be deleted at shutdown.

This is somewhat brute-force (but good to have in place nonetheless) as
the deletion of the local data should be done by the Service and before
the routing worker thread has exited.
This commit is contained in:
Johan Wikman 2019-07-30 10:52:21 +03:00
parent ee8042c40b
commit ed84f29fca

View File

@ -267,6 +267,17 @@ RoutingWorker::RoutingWorker()
RoutingWorker::~RoutingWorker()
{
for (uint64_t key = 0; key < m_local_data.size(); ++key)
{
auto* pData = m_local_data[key];
auto deleter = m_data_deleters[key];
if (pData && deleter)
{
deleter(pData);
}
}
delete m_pWatchdog_notifier;
}