lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I want to get the __gc metamethod for tables.  So I use the workaround to create the proxy userdata with real __gc method and associate it to the interested table object in another weakreferenced table.

It seems working except I loose the first table object I make.  Meaning

   a = createfoo('one')
   b = createfoo('two')
   c = createfoo('three')

   a = nil
   b = nil
   c = nil


then I see

   DEBUG: mygc() freeing 'three'
   DEBUG: mygc() freeing 'two'

then that is it.  The 'one' foo is never called.  And I look in my associating table and it is empty. Any idea to what happens?  And it is 5.0.2 if it is meaningful.

Sign-up for Ads Free at