]> err.no Git - mapper/commitdiff
Destroy icon cache on deinit. Add function to clear the icon cache.
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 10 Jan 2008 16:13:19 +0000 (18:13 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 10 Jan 2008 16:13:19 +0000 (18:13 +0200)
src/poi.c

index fb550bc77e046063b6e27d06e6551fce1cfe523b..ffb983d39cacd6ee911ef25dbb1991ac6b01155a 100644 (file)
--- a/src/poi.c
+++ b/src/poi.c
@@ -346,9 +346,20 @@ poi_db_prepare(sqlite3 *db)
        return TRUE;
 }
 
+void
+poi_icon_hash_clear(void)
+{
+g_hash_table_remove_all(poi_icon_hash);
+}
+
 void
 poi_deinit(sqlite3 *db)
 {
+if (poi_icon_hash) {
+       g_hash_table_destroy(poi_icon_hash);
+       poi_icon_hash=NULL;
+}
+
 sqlite3_finalize(poisql.select_quick_cat);
 sqlite3_finalize(poisql.selall_cat);
 sqlite3_finalize(poisql.toggle_cat);
@@ -370,7 +381,7 @@ gboolean
 poi_init(sqlite3 **db)
 {
 if (!poi_icon_hash)
-       poi_icon_hash=g_hash_table_new(g_str_hash, g_str_equal);
+       poi_icon_hash=g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 
 if (!db || !*db)
        return FALSE;