lua-users home
lua-l archive

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

>I'm using Lua to extend Moray - a 3D modeller for POV-Ray that runs 
>under Windows - but I noticed that, in some situations, Lua calls 
>_ALERT (wich has been redefined to pop a MessageBox) and exits.
>Well, I can't let Lua exit without giving the user the chance to save 
>his/her work. So I would like to know where exactly Lua can call exit
>() and how to avoid it.

If you redefine _ERRORMESSAGE or _ALERT to do your own error handling
and avoid exit().
Or you can register a function to be called when exit is called.
See atexit() from the C library.