libpkgconf: pkg: add refcount debugging
parent
b6a56c8728
commit
4c0cc29277
|
@ -480,6 +480,8 @@ pkgconf_pkg_ref(const pkgconf_client_t *client, pkgconf_pkg_t *pkg)
|
|||
(void) client;
|
||||
|
||||
pkg->refcount++;
|
||||
PKGCONF_TRACE(client, "refcount@%p: %d", pkg, pkg->refcount);
|
||||
|
||||
return pkg;
|
||||
}
|
||||
|
||||
|
@ -498,6 +500,8 @@ void
|
|||
pkgconf_pkg_unref(pkgconf_client_t *client, pkgconf_pkg_t *pkg)
|
||||
{
|
||||
pkg->refcount--;
|
||||
PKGCONF_TRACE(client, "refcount@%p: %d", pkg, pkg->refcount);
|
||||
|
||||
if (pkg->refcount <= 0)
|
||||
pkgconf_pkg_free(client, pkg);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue