Fix:core:Fixed crashes after downloading map data
authorrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 7 Jun 2011 19:28:39 +0000 (19:28 +0000)
committerrikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Tue, 7 Jun 2011 19:28:39 +0000 (19:28 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4516 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/cache.c

index 0ef4175..fcf5137 100644 (file)
@@ -277,6 +277,16 @@ cache_flush(struct cache *cache, void *id)
        }
 }
 
+void
+cache_flush_data(struct cache *cache, void *data)
+{
+       struct cache_entry *entry=(struct cache_entry *)((char *)data-cache->entry_size);
+       if (entry) {
+               cache_remove_from_list(entry->where, entry);
+               cache_remove(cache, entry);
+       }
+}
+
 
 void *
 cache_lookup(struct cache *cache, void *id) {