lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Sorry I ment the other way around, is GC everything guaranteed on end
of script due to return?

On Tue, Mar 8, 2011 at 4:58 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
>> Is it guaranteed by Lua that all __gc's are called when a script
>> exit-returns? Or is just a random trait of the current implementation?
>
> No. It is not even a random trait: when you call os.exit Lua will not
> execute any __gc. (Lua 5.2 supports an extra argument to os.exit
> that will force a proper close of the Lua state before exiting.)
>
> -- Roberto
>
>