]> git.street.me.uk Git - andy/viking.git/blobdiff - src/mapcache.c
Read hgt.zip files directly. Process correctly 1 arc sec hgt(.zip) files
[andy/viking.git] / src / mapcache.c
index 6df3d8c16ae13f449a18183bba0e806b77aebef0..f697252d975c2832059d3a57df4bc1be80f6422e 100644 (file)
@@ -132,7 +132,7 @@ GdkPixbuf *a_mapcache_get ( gint x, gint y, gint z, guint8 type, guint zoom, gui
   return g_hash_table_lookup ( cache, key );
 }
 
   return g_hash_table_lookup ( cache, key );
 }
 
-void a_mapcache_remove_all_shrinkfactors ( guint16 x, guint16 y, guint16 z, guint8 type, guint zoom )
+void a_mapcache_remove_all_shrinkfactors ( gint x, gint y, gint z, guint8 type, guint zoom )
 {
   char key[40];
   List *loop = queue_tail;
 {
   char key[40];
   List *loop = queue_tail;
@@ -151,10 +151,13 @@ void a_mapcache_remove_all_shrinkfactors ( guint16 x, guint16 y, guint16 z, guin
     if ( strncmp(tmp->key, key, len) == 0 )
     {
       g_hash_table_remove ( cache, tmp->key );
     if ( strncmp(tmp->key, key, len) == 0 )
     {
       g_hash_table_remove ( cache, tmp->key );
-      if ( tmp == loop )
+      if ( tmp == loop ) /* we deleted the last thing in the queue! */
         loop = queue_tail = NULL;
         loop = queue_tail = NULL;
-      else
+      else {
         loop->next = tmp->next;
         loop->next = tmp->next;
+        if ( tmp == queue_tail )
+          queue_tail = tmp->next;
+      }
       g_free ( tmp );
       tmp = NULL;
     }
       g_free ( tmp );
       tmp = NULL;
     }