1
mirror of https://code.videolan.org/videolan/vlc synced 2024-10-03 01:31:53 +02:00

access: cache: don't call free_cb from entry_Delete

No functional changes, vlc_access_cache_entry_Delete() is not (yet)
called from the outside.
This commit is contained in:
Thomas Guillem 2022-03-17 14:35:40 +01:00 committed by Hugo Beauzée-Luyssen
parent ff0e681fed
commit dc4b8c6bc9
2 changed files with 6 additions and 1 deletions

View File

@ -38,7 +38,6 @@ vlc_access_cache_entry_Delete(struct vlc_access_cache_entry *entry)
free(entry->url);
free(entry->username);
entry->free_cb(entry->context);
free(entry);
}
@ -86,6 +85,7 @@ vlc_access_cache_Thread(void *data)
vlc_mutex_unlock(&cache->lock);
entry->free_cb(entry->context);
vlc_access_cache_entry_Delete(entry);
vlc_mutex_lock(&cache->lock);
@ -133,7 +133,10 @@ vlc_access_cache_Destroy(struct vlc_access_cache *cache)
struct vlc_access_cache_entry *entry;
vlc_list_foreach(entry, &cache->entries, node)
{
entry->free_cb(entry->context);
vlc_access_cache_entry_Delete(entry);
}
}
void
@ -147,6 +150,7 @@ vlc_access_cache_AddEntry(struct vlc_access_cache *cache,
if (!cache->running)
{
vlc_mutex_unlock(&cache->lock);
entry->free_cb(entry->context);
vlc_access_cache_entry_Delete(entry);
return;
}

View File

@ -85,6 +85,7 @@ vlc_access_cache_entry_NewSmb(void *context, const char *server,
return entry;
}
/* Delete the cache entry without firing the free_cb */
void
vlc_access_cache_entry_Delete(struct vlc_access_cache_entry *entry);