[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Small question about os.exit and __gc
- From: Rob Kendrick <rjek@...>
- Date: Fri, 14 Mar 2014 11:55:36 +0000
On Fri, Mar 14, 2014 at 03:48:40PM +0400, Dio Darkclainer wrote:
> Hi all!
> In stand-alone lua interpreter:
>
> a = {__gc = function() print'exit' end}
> setmetatable(a,a)
> os.exit()
By default, os.exit() assumes the OS will clean up any allocated
resources. See the manual for how to change this:
http://www.lua.org/manual/5.2/manual.html#pdf-os.exit
(5.2 and newer only; in earlier verions there is no way to override
this, IIRC)
B.