dependency: add refcount trace to dependency

This works like the pkg tracing, but for dependencies
Dylan Baker 2022-07-27 11:26:07 -07:00
parent 283050cc42
commit 7cd86508a3
1 changed files with 4 additions and 1 deletions

View File

@ -222,6 +222,7 @@ pkgconf_dependency_ref(pkgconf_client_t *client, pkgconf_dependency_t *dep)
return NULL;
dep->refcount++;
PKGCONF_TRACE(client, "%s: refcount@%p: %d", dep->package, dep, dep->refcount);
return dep;
}
@ -242,7 +243,9 @@ pkgconf_dependency_unref(pkgconf_client_t *client, pkgconf_dependency_t *dep)
if (client != dep->owner)
return;
if (--dep->refcount <= 0)
dep->refcount--;
PKGCONF_TRACE(client, "%s: refcount@%p: %d", dep->package, dep, dep->refcount);
if (dep->refcount <= 0)
pkgconf_dependency_free_one(dep);
}