Access db->pkgcache directly in db_free_pkgcache()

We shouldn't be going through the accessor that does a bunch of
unnecessary legwork, including potentially loading the pkgcache right
before we free it.

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2011-09-19 14:27:21 -05:00
parent 95119d46d4
commit 3796164848
1 changed files with 4 additions and 2 deletions

View File

@ -508,9 +508,11 @@ void _alpm_db_free_pkgcache(alpm_db_t *db)
_alpm_log(db->handle, ALPM_LOG_DEBUG,
"freeing package cache for repository '%s'\n", db->treename);
alpm_list_free_inner(_alpm_db_get_pkgcache(db),
if(db->pkgcache) {
alpm_list_free_inner(db->pkgcache->list,
(alpm_list_fn_free)_alpm_pkg_free);
_alpm_pkghash_free(db->pkgcache);
_alpm_pkghash_free(db->pkgcache);
}
db->status &= ~DB_STATUS_PKGCACHE;
free_groupcache(db);