Another collectgarbage question. (Inherited class)
Taesoo Kwon <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I am using luabind 0.8.1, lua5.1.4, MSVC2005.
I have an example where garbage collection doesn't work for a derived lua
class.
Is this a normal behavior? What should I modify?
class 'VVV'
function VVV:__init()
print("ctor VVV")
end
function VVV:__finalize()
print("dtor VVV")
end
class 'GCtest'
function GCtest:__init()
self.skel=VVV()
end
class 'GCtest2'(GCtest) -- derived class
function GCtest2:__init()
GCtest.__init(self)
end
function gctest()
do
local test=GCtest()
end
collectgarbage() -- dtor of VVV is called.
collectgarbage()
collectgarbage()
do
local test=GCtest2()
end
collectgarbage()
collectgarbage()
collectgarbage() -- dtor of VVV is not called.
end
Thank you.
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user