#include <gelf.h>
+#include <pakfire/ctx.h>
#include <pakfire/constants.h>
#include <pakfire/digest.h>
#include <pakfire/fhs.h>
};
struct pakfire_file {
+ struct pakfire_ctx* ctx;
struct pakfire* pakfire;
int nrefs;
if (!f)
return 1;
+ // Store a reference to the context
+ f->ctx = pakfire_ctx(pakfire);
+
// Store reference to Pakfire
f->pakfire = pakfire_ref(pakfire);
cap_free(file->caps);
if (file->entry)
archive_entry_free(file->entry);
- pakfire_unref(file->pakfire);
+ if (file->pakfire)
+ pakfire_unref(file->pakfire);
+ if (file->ctx)
+ pakfire_ctx_unref(file->ctx);
free(file);
}