summaryrefslogtreecommitdiff
path: root/navit/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/cache.c')
-rw-r--r--navit/cache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/navit/cache.c b/navit/cache.c
index 0d37a06f8..50a1ad9ac 100644
--- a/navit/cache.c
+++ b/navit/cache.c
@@ -219,11 +219,12 @@ static struct cache_entry *
cache_move(struct cache *cache, struct cache_entry_list *old, struct cache_entry_list *new)
{
struct cache_entry *entry;
- entry=cache_remove_lru(NULL, old);
+ // remove from list AND cache, because next cache lookup can't read the id after trim
+ entry=cache_remove_lru(cache, old);
if (! entry)
return NULL;
entry=cache_trim(cache, entry);
- cache_insert_mru(NULL, new, entry);
+ cache_insert_mru(cache, new, entry);
return entry;
}