From ed84f29fcae4b47fe649e0e86741bd74df476649 Mon Sep 17 00:00:00 2001 From: Johan Wikman Date: Tue, 30 Jul 2019 10:52:21 +0300 Subject: [PATCH] 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 vectors 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. --- server/core/routingworker.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/core/routingworker.cc b/server/core/routingworker.cc index b06e17842..6bd8cf3ad 100644 --- a/server/core/routingworker.cc +++ b/server/core/routingworker.cc @@ -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; }