News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.

Post Reply  Post Thread 
table reset
Author Message

Posts: 113
Group: Registered
Joined: Jul 2007
Status: Offline
Reputation: 0
Post: #1
RE: table reset

really doing something like t={} where t previously contained the table loaded by the function, effectively disconnects the table (value) from the reference (t), and if there aren't any other strong references to this table, it will get deleted upon the next garbage collection cycle. For a read up on garbage collection and strong and weak references, take a look at

I however don't know how the widgets work with this system, whether there remains any reference in Lua. It seems to me, that normally, if everything is implemented in the Lua-way if there aren't any live references to this object it should be removed upon garbage collection. I think (only learning to use the Lua C-API really recently) that it could be possible murgaLua keeps a reference on the C-side, inaccessible to Lua.

To check what happens to data at garbage collection you could (at least for userdata) set the __gc metamethod to print something. For example:

getmetatable(w).__gc=function(window) print("Bye Bye from window") end

prints out the message.
Don't know however how this behaves when Fl:run() has been activated, but you could use the above trick to verify.

12-04-2010 11:16 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
table reset - mikshaw - 12-04-2010, 01:37 AM
RE: table reset - jpjacobs - 12-04-2010 11:16 AM
RE: table reset - mikshaw - 12-04-2010, 01:37 PM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: