[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: how to store a ref to a table without registry?
- From: joerg piringer <joerg@...>
- Date: Thu, 20 Mar 2008 12:17:46 +0100
i am pretty new to lua so please forgive me if this question has been
i'd like to access a function (or rather a method) inside a specific
table from c++. how can i do that without storing the reference to the
table in the registry?
the problem is when i store the reference in the registry it won't get
garbage collected, right?
i have the following code:
o = TestObject()
o.testFunc = function() print "test" end
TestObject() is a c++ function that returns a table with a userdata
inside (the actual c++ object).
now i'd like to call my testFunc from the c++ object that's inside the
i did it with a reference (in the registry) to self (the table) until i
tried to garbage collect the objects...