Module: do not write to maybe deleted storage

This commit is contained in:
Martin Pulec
2020-03-13 16:39:01 +01:00
parent 0ba62604d0
commit 33bdcb48ad

View File

@@ -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[] = {