aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/util.c
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@hardinfo.org>2010-01-03 17:19:07 -0200
committerLeandro Pereira <leandro@hardinfo.org>2010-01-03 17:19:07 -0200
commit93f39a984398e9f4d187b66eb272ec0bf48845e0 (patch)
tree35a14aa48a17c5281a9e6e697aac734233afa9e4 /hardinfo2/util.c
parentc8bc96a5431c1435be52a268d5a14c13ef90006d (diff)
Add a module deinitialization function, so modules can deallocate memory on unload.
Diffstat (limited to 'hardinfo2/util.c')
-rw-r--r--hardinfo2/util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/hardinfo2/util.c b/hardinfo2/util.c
index 87521028..43a3677e 100644
--- a/hardinfo2/util.c
+++ b/hardinfo2/util.c
@@ -593,6 +593,9 @@ static void module_unload(ShellModule * module)
if (module->dll) {
gchar *name;
+ if (module->deinit)
+ module->deinit();
+
name = g_path_get_basename(g_module_name(module->dll));
g_hash_table_foreach_remove(__module_methods, remove_module_methods, name);
@@ -697,6 +700,8 @@ static ShellModule *module_load(gchar * filename)
g_module_symbol(module->dll, "hi_module_get_about",
(gpointer) & (module->aboutfunc));
+ g_module_symbol(module->dll, "hi_module_deinit",
+ (gpointer) & (module->deinit));
entries = get_module_entries();
while (entries[i].name) {