summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libappstream-glib/as-ref-string.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libappstream-glib/as-ref-string.c b/libappstream-glib/as-ref-string.c
index 054d243..702de91 100644
--- a/libappstream-glib/as-ref-string.c
+++ b/libappstream-glib/as-ref-string.c
@@ -64,6 +64,12 @@ as_ref_string_get_hash_safe (void)
return as_ref_string_hash;
}
+static void __attribute__ ((destructor))
+as_ref_string_destructor (void)
+{
+ g_clear_pointer (&as_ref_string_hash, g_hash_table_unref);
+}
+
/**
* as_ref_string_new_static:
* @str: a string