diff mcabber/mcabber/settings.c @ 2339:7f11a567d236

Implemented settings_free() This removes many leaked memory messages from valgrind and thus makes it easier to read its output.
author franky
date Sat, 18 May 2019 20:44:01 +0200
parents ffd0e57e9563
children 6eeef7be58f3
line wrap: on
line diff
--- a/mcabber/mcabber/settings.c	Sun May 12 13:17:36 2019 +0200
+++ b/mcabber/mcabber/settings.c	Sat May 18 20:44:01 2019 +0200
@@ -86,6 +86,20 @@
 #endif
 }
 
+void settings_free(void)
+{
+  g_hash_table_destroy(option);
+  g_hash_table_destroy(alias);
+  g_hash_table_destroy(binding);
+  g_hash_table_destroy(guards);
+#ifdef HAVE_GPGME
+  g_hash_table_destroy(pgpopt);
+#endif
+#ifdef HAVE_LIBOTR
+  g_hash_table_destroy(otrpolicy);
+#endif
+}
+
 //  settings_get_mcabber_config_dir()
 // Returns the mcabber configuration directory.
 // The directory is looked up for only once (and the string is never freed,