From 33bdcb48ad29edf24fe7882e9ec1124ef39bd4ef Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Fri, 13 Mar 2020 16:39:01 +0100 Subject: [PATCH] Module: do not write to maybe deleted storage --- src/module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module.c b/src/module.c index 951d4b6e7..47d2fbf92 100644 --- a/src/module.c +++ b/src/module.c @@ -101,6 +101,8 @@ void module_done(struct module *module_data) memcpy(&tmp, module_data, sizeof(struct module)); pthread_mutex_unlock(&module_data->lock); + module_data->cls = MODULE_CLASS_NONE; + if(module_data->deleter) module_data->deleter(module_data); @@ -136,8 +138,6 @@ void module_done(struct module *module_data) pthread_mutex_destroy(&tmp.lock); free(tmp.name); - - module_data->cls = MODULE_CLASS_NONE; } static const char *module_class_name_pairs[] = {