Search code examples
zerobrane

Why press the stop debugging button during a debugging session crashes the host?


I've successfully managed to implement ZBS to debug the scripting code of a C++ real time game. It works really great!

However, there is still an issue that I don't know how to solve: if I press the stop debugging button or menu option during a debugging session, my C++ host program crashes.

Would you please give me ideas of why this could be happening?

Thanks a lot in advance, kind regards,

Mauricio.


Solution

  • Stopping debugging calls os.exit(1, true) by default, so you will need to check if the resources are correctly released in this case. If you want to provide your own handler, you can do it by setting require('mobdebug').onexit = function() --[[your exit handler]] end in your application.