+ g_mutex_unlock(mc_mutex);
+}
+
+void a_mapcache_flush ()
+{
+ List *loop = queue_tail;
+ List *tmp;
+
+ if ( queue_tail == NULL )
+ return;
+
+ g_mutex_lock(mc_mutex);
+ do {
+ tmp = loop->next;
+ cache_remove(tmp->key);
+ if ( tmp == queue_tail ) /* we deleted the last thing in the queue */
+ loop = queue_tail = NULL;
+ else
+ loop->next = tmp->next;
+ g_free ( tmp );
+ tmp = NULL;
+ } while ( loop );
+
+ g_mutex_unlock(mc_mutex);