[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: calling collectgarbage in __gc metamethod
- From: Coda Highland <chighland@...>
- Date: Mon, 6 Aug 2012 09:58:11 -0700
On Mon, Aug 6, 2012 at 9:55 AM, Atilim Cetin <atilim.cetin@gmail.com> wrote:
> Hi,
>
> When I call collectgarbage in a __gc metamethod, Lua GC tries to collect
> another userdata and therefore calls another __gc metamethod before
> finishing the current one. And destructing two objects simultaneously
> results in crashing. I'm using Lua 5.1.4.
>
> Do you know a way to avoid this situation?
>
> Thank you.
>
> --
> Atilim Cetin
>
"Doctor, it hurts when I do this."
Don't call collectgarbage in a __gc metamethod?
I mean, I don't know what the technical details involved here are, but
this sounds intuitively like a big no-no. What are you trying to
accomplish, anyway?
/s/ Adam