You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this impacted by the refcouting changes in #171?
No, there is still a reference cycle.
Basically, in the example I gave, d is holding "hostage" the reference to _LuaTable, which holds "hostage" the reference to the Lua table in the registry (altough Python can't track the reference identifier down). In Lua, the table is holding "hostage" the reference to the userdata that points to d.
I am using the word "hostage" here figuratively to emphasize that it's the only reference left!
The problem here is that while there is clearly for us a reference cycle, it is split between languages and they can't see the full picture.
A dependency cycle avoids both Lua references and Python references from being collected by their respective garbage collection systems.
How to reproduce
This example uses __gc on tables, which is a feature not present in Lua 5.1, but is only there to show how the Lua object is not collected.
The text was updated successfully, but these errors were encountered: