Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
struct pakfire_repo* pakfire_repo_create_from_repo(struct pakfire* pakfire, Repo* r) {
struct pakfire_repo* repo = calloc(1, sizeof(*repo));
if (repo) {
- repo->nrefs = 1;
+ // Store a reference to the context
+ repo->ctx = pakfire_ctx(pakfire);
+ // Store a reference to Pakfire
repo->pakfire = pakfire_ref(pakfire);
+ // Initialize the reference counter
+ repo->nrefs = 1;
+
// Reference repository
repo->repo = r;
repo->appdata = r->appdata;