pkg: add trace log when breaking a circular reference

master
Ariadne Conill 2022-08-07 01:09:07 +00:00
parent 59a56dfa64
commit 662668d082
1 changed files with 3 additions and 0 deletions

View File

@ -1470,12 +1470,15 @@ pkgconf_pkg_walk_list(pkgconf_client_t *client,
if (pkgdep->serial == client->serial)
{
pkgdep->hits++;
/* In this case we have a circular reference.
* We break that by deleteing the circular node from the
* the list, so that we dont create a situation where
* memory is leaked due to circular ownership.
* i.e: A owns B owns A
*/
PKGCONF_TRACE(client, "breaking circular reference: %s", depnode->package);
pkgconf_node_delete(node, deplist);
pkgconf_dependency_unref(client, depnode);
goto next;