[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: luacom paralyzes os.exit
- From: Kenneth LO <kenlo88@...>
- Date: Thu, 4 Mar 2010 20:34:53 +0800
I was thinking whether special destructor was required to release COM
objects as the php manual seemed to suggest so (by registering them
with exit, for example). If it is necessary, then solely releasing
the lua state would not do the job, wouldn't it?
I was perplexed by the DllMain and CoUnInitialize functions. How is
that implemented in other scripting languages? I suppose all
programmers use some sort of exit or die functions in any case.
Back to luacom. I am instantiating COM objects and freeing them in a
loop according to the luacom manual, relying on __gc to free the
memory. I found that memory allocation reached a threshold then it
stopped responding. Memory allocation remained constant at a high
level but CPU usage dropped to zero. I was suspecting that __gc was
not working. I work around it by calling collectgarbage at every
cycle. The script still hangs at some stage but I'm not sure it is a
memory leakage at the COM object or elsewhere.