✨ feat(module manager): store spec path and cb name
This commit is contained in:
@@ -62,9 +62,9 @@ int module_specs_load(toml_table_t* conf, struct module_spec_load **mod_spec)
|
||||
if (!mod_spec[i]->on_exit_cb) {
|
||||
fprintf(stderr, "Could not load exit function %s: %s\n", exit_func_name, dlerror());
|
||||
}
|
||||
FREE(path);
|
||||
FREE(init_func_name);
|
||||
FREE(exit_func_name);
|
||||
mod_spec[i]->path=path;
|
||||
mod_spec[i]->init_cb_name=init_func_name;
|
||||
mod_spec[i]->exit_cb_name=exit_func_name;
|
||||
}
|
||||
return mod_num;
|
||||
MODULE_SPEC_LOAD_ERROR:
|
||||
@@ -127,6 +127,9 @@ void stellar_module_manager_free(struct stellar_module_manager *mod_mgr)
|
||||
{
|
||||
mod_mgr->schema.module_specs[i].on_exit_cb(mod_mgr, mod_mgr->schema.module_specs[i].mod);
|
||||
}
|
||||
if(mod_mgr->schema.module_specs[i].path)FREE(mod_mgr->schema.module_specs[i].path);
|
||||
if(mod_mgr->schema.module_specs[i].init_cb_name)FREE(mod_mgr->schema.module_specs[i].init_cb_name);
|
||||
if(mod_mgr->schema.module_specs[i].exit_cb_name)FREE(mod_mgr->schema.module_specs[i].exit_cb_name);
|
||||
}
|
||||
FREE(mod_mgr->schema.module_specs);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user