lua-users home
lua-l archive

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


Am 08.10.12 11:21, schrieb Thijs Schreijer:

[...]

> Just looked up the os.exit() in the ref manual, and it differs for 5.1 / 5.2
> 
> For 5.1:
> --------
>> os.exit ([code])
>> Calls the C function exit, with an optional code, to terminate 
>> the host program. The default value for code is the success code. 
> 
> For 5.2:
> --------
>> os.exit ([code [, close])
>> Calls the C function exit to terminate the host program. If code 
>> is true, the returned status is EXIT_SUCCESS; if code is false, 
>> the returned status is EXIT_FAILURE; if code is a number, the 
>> returned status is this number. The default value for code is true. 
>>
>> If the optional second argument close is true, closes the Lua state 
>> before exiting. 
> 
> For __gc to run the Lua state must be closed as mentioned with the 5.2 os.exit(). What isn't mentioned is what Lua state is being closed, but I would assume only the current state. Some clarification in the manual would be nice.

Thanks for digging this up!