lua-users home
lua-l archive

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


2010/2/28 Ignacio Burgueño:
> On 26/02/2010 06:16, Kenneth LO wrote:
>> This code will hang on my XP SP2.
>>
>>   require "luacom"
>>   excel = luacom.CreateObject("Excel.Application")
>>   os.exit()
>
> By calling os.exit, you're bypassing COM uninitialization...
> But remember, it is best to exit cleanly.

Note that Lua 5.2.0-work2 has an additional parameter on the os.exit function:

  "os.exit ([code [, close]) Calls the C function exit, with an
optional code, to terminate the host program. The default value for
code is the success code. If the optional second argument close is
true, closes the Lua state before exiting."

 I agree, it's best to avoid os.exit and just return normally.