Fix filter destruction

The filter instances weren't cleared before the dynamically loaded
libraries were unloaded which caused a crash.
This commit is contained in:
Markus Mäkelä 2018-09-24 10:12:14 +03:00
parent 6d82de811f
commit f17dfdbc2b
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
2 changed files with 2 additions and 9 deletions

View File

@ -187,15 +187,7 @@ void filter_destroy(const SFilterDef& filter)
void filter_destroy_instances()
{
Guard guard(this_unit.lock);
for (const auto& filter : this_unit.filters)
{
// NOTE: replace this with filter_destroy
if (filter->obj->destroyInstance)
{
filter->obj->destroyInstance(filter->filter);
}
}
this_unit.filters.clear();
}
const char* filter_def_get_name(const MXS_FILTER_DEF* filter_def)

View File

@ -2257,6 +2257,7 @@ int main(int argc, char** argv)
* Destroy the router and filter instances of all services.
*/
service_destroy_instances();
filter_destroy_instances();
RoutingWorker::finish();
maxbase::finish();