From e68e994eb2c32c4b7ad5288f8f4b8809e1c39c9b Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Thu, 24 Mar 2011 15:10:01 -0400 Subject: alpm/db: do not close local DB in alpm_db_unregister_all pacman 3.5.0 removed alpm_db_register_local, so calling alpm_db_unregister_all leaves the front end in a position where there's no local db, and no way to re-register it. Signed-off-by: Dave Reisner Signed-off-by: Dan McGee --- lib/libalpm/alpm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/libalpm/alpm.c') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 4f95832d..a60a4bb6 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); } -- cgit v1.2.3-24-g4f1b