repo: introduce xbps_repo_release(), misc changes.
- xbps_repo_release(): new function to release all resources associated with a repository object. - xbps_repo_close(): this now just closes the file descriptor associated with the archive and associated resources. - repo_open_local: after getting the repository dictionaries, use xbps_repo_close() to release archive resources. Bump XBPS_API_VERSION.
This commit is contained in:
@@ -120,16 +120,18 @@ xbps_rpool_get_repo(const char *url)
|
||||
}
|
||||
|
||||
void
|
||||
xbps_rpool_release(struct xbps_handle *xhp UNUSED)
|
||||
xbps_rpool_release(struct xbps_handle *xhp)
|
||||
{
|
||||
struct xbps_repo *repo;
|
||||
|
||||
while ((repo = SIMPLEQ_FIRST(&rpool_queue))) {
|
||||
SIMPLEQ_REMOVE(&rpool_queue, repo, xbps_repo, entries);
|
||||
xbps_repo_close(repo);
|
||||
xbps_repo_release(repo);
|
||||
}
|
||||
if (xhp->repositories)
|
||||
if (xhp && xhp->repositories) {
|
||||
xbps_object_release(xhp->repositories);
|
||||
xhp->repositories = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
Reference in New Issue
Block a user