Re: collectgarbage question.
Tony Kostanjsek <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]>
An: [email protected]
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 <[email protected]> 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.
>
------------------------------------------------------------------------------
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