# HG changeset patch # User Mark Doliner # Date 1247073600 0 # Node ID 8368e4fb7d3a219b9bd4343fbebb689d5df764ae # Parent d4cfd179203b03d8973a1da350540e562a6c3ccc Don't double-free the color hash table when deinitializing both prpl-yahoo and prpl-yahoojp. This caused a crash-at-exit when you had signed onto both types of accounts during your session. diff -r d4cfd179203b -r 8368e4fb7d3a libpurple/protocols/yahoo/util.c --- a/libpurple/protocols/yahoo/util.c Wed Jul 08 17:02:07 2009 +0000 +++ b/libpurple/protocols/yahoo/util.c Wed Jul 08 17:20:00 2009 +0000 @@ -214,8 +214,12 @@ void yahoo_init_colorht() { + if (ht != NULL) + /* Hash table has already been initialized */ + return; + ht = g_hash_table_new(g_str_hash, g_str_equal); -/* the numbers in comments are what gyach uses, but i think they're incorrect */ + /* the numbers in comments are what gyach uses, but i think they're incorrect */ g_hash_table_insert(ht, "30", ""); /* black */ g_hash_table_insert(ht, "31", ""); /* blue */ g_hash_table_insert(ht, "32", ""); /* cyan */ /* 00b2b2 */ @@ -284,7 +288,12 @@ void yahoo_dest_colorht() { + if (ht == NULL) + /* Hash table has already been destroyed */ + return; + g_hash_table_destroy(ht); + ht = NULL; } static int point_to_html(int x)