[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: userdata environment garbage collection
- From: Timothy Hunter <rmagick@...>
- Date: Thu, 24 Mar 2011 20:21:49 -0400
I'm trying to understand how garbage collection works for userdata environments.
I allocate a userdata and then call lua_setfenv to set an environment table for it. Then I allocate a 2nd userdata and store it in the environment table. Eventually Lua collects the 1st userdata.
I assume that the 2nd userdata will not be collected until the reference in the environment table goes away. Is that correct? Do I need to do anything to allow the environment table to be collected? After the environment table is collected, do I need to do anything to allow the 2nd userdata to be collected?