FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 09-19-2011, 08:13 PM
Dan McGee
 
Default 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>
---
lib/libalpm/db.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 765448d..7708d18 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -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'
", 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);
--
1.7.6.1
 

Thread Tools




All times are GMT. The time now is 09:24 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org