diff options
author | Dan McGee <dan@archlinux.org> | 2011-03-25 03:18:09 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-03-25 03:18:09 +0100 |
commit | 86e7f6075671e08c456f389d8ecba47190c03f0f (patch) | |
tree | 2698fd22bbb781a6227ed84b5ef8bbacab647e6e /lib/libalpm | |
parent | cfa2eebdafc4d2341621e24ce61dd5a74a0de9fc (diff) | |
parent | c37c9c5dcae06c1585b4da4c0b838f5b44e1498e (diff) | |
download | pacman-86e7f6075671e08c456f389d8ecba47190c03f0f.tar.gz pacman-86e7f6075671e08c456f389d8ecba47190c03f0f.tar.xz |
Merge branch 'maint'
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/alpm.c | 9 | ||||
-rw-r--r-- | lib/libalpm/db.c | 8 |
2 files changed, 11 insertions, 6 deletions
diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 4d40d675..bafd922b 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -77,10 +77,19 @@ int SYMEXPORT alpm_initialize(void) */ int SYMEXPORT alpm_release(void) { + pmdb_t *db; + ALPM_LOG_FUNC; ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1)); + /* close local database */ + db = handle->db_local; + if(db) { + db->ops->unregister(db); + handle->db_local = NULL; + } + if(alpm_db_unregister_all() == -1) { return -1; } diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c index 4bb24a6c..b2144354 100644 --- a/lib/libalpm/db.c +++ b/lib/libalpm/db.c @@ -90,12 +90,8 @@ int SYMEXPORT alpm_db_unregister_all(void) /* Do not unregister a database if a transaction is on-going */ ASSERT(handle->trans == NULL, RET_ERR(PM_ERR_TRANS_NOT_NULL, -1)); - /* close local database */ - db = handle->db_local; - if(db) { - db->ops->unregister(db); - handle->db_local = NULL; - } + /* since the local DB is registered in alpm_initialize(), we'll be + * symmetrical and let the cleanup occur in alpm_release() */ /* and also sync ones */ for(i = handle->dbs_sync; i; i = i->next) { |