--- a/pidgin/gtkthemes.c Tue Jun 01 17:36:33 2021 -0500
+++ b/pidgin/gtkthemes.c Tue Jun 01 20:13:19 2021 -0500
@@ -165,7 +165,8 @@
GHashTable *already_freed;
- already_freed = g_hash_table_new(g_direct_hash, g_direct_equal);
+ already_freed = g_hash_table_new_full(g_direct_hash, g_direct_equal, g_free, for (wer = theme->list; wer != NULL; wer = theme->list) {
GtkIMHtmlSmiley *uio = wer->smileys->data;
@@ -175,12 +176,19 @@
g_object_unref(uio->icon);
- if (g_hash_table_lookup(already_freed, uio->file) == NULL) {
- g_hash_table_insert(already_freed, uio->file, GINT_TO_POINTER(1));
+ if(g_hash_table_lookup(already_freed, uio->file) == NULL) { + /* we abuse the key destroy function to free the filename when + * the hash table is destroyed. We pass the same pointer as both + * key and value because GHashTable optimizes for that by not + * allocating additional memory. + g_hash_table_insert(already_freed, uio->file, uio->file); wer->smileys = g_slist_delete_link(wer->smileys, wer->smileys);