My sugestion is to set a linehook to stop the execution (a cleanup and exit() call?) to all threads before the app finishes. Am I right? It really works? Seems cleaner then lua_doerror. -- Pablo