Re: [luabind] collectgarbage question.
Brought to you by:
arvidn,
daniel_wallin
From: Tony K. <lob...@ya...> - 2009-09-23 22:54:52
|
have you tried collectgarbage("collect") to perform a full garbage collection cycle? I'm not even sure what it does without an argument: http://www.lua.org/manual/5.1/manual.html ________________________________ Von: Taesoo Kwon <tae...@gm...> An: lua...@li... Gesendet: Mittwoch, den 23. September 2009, 23:04:16 Uhr Betreff: Re: [luabind] collectgarbage question. I am sorry. This wasn't a bug but a feature of lua 5.1.4. I had to add one more collectgarbage() call. do local skel=VRMLloader("aa.wrl") skel.dofInfo:setFrameRate(30) end collectgarbage() collectgarbage() -- two cycles are needed. On Wed, Sep 23, 2009 at 4:36 PM, Taesoo Kwon <tae...@gm...> wrote: Hi, > >I am using luabind-0.8.1, lua 5.1.4, and VC2005. >I have a strange bug; collect garbage doesn't work in the following simple code. > >----------------------------------------------------------------------- >>test1.lua -> Garbage collection doesn't work. (the dtor of VRMLloader class is not called.) > > do > local skel=VRMLloader("aa.wrl") > skel.dofInfo:setFrameRate(30) > end > collectgarbage() > >----------------------------------------------------------------------- >test2.lua -> Garbage collection works. (dtor called) > > do >> local skel=VRMLloader("aa.wrl") >> end >> collectgarbage() > >I have no idea what could cause the difference. Has anybody observed similar situation? > >----------------------------------------------------------------------- >binding: > >class VRMLloader: public MotionLoader >> > >{ >>public: >> MotionDOFinfo dofInfo; > >> VRMLloader(const char* vrmlFile); >> virtual ~VRMLloader() { printf("dtor called");} >> ... >>}; > > luabind::class_<VRMLloader, MotionLoader>("VRMLloader") > .def_readwrite("dofInfo", &VRMLloader::dofInfo) > .def(luabind::constructor<const char*>()) > > > >Thanks. > |