Quit debug web app

This sounds like a no-brainer, so sorry, but I’m struggling.

I need my web app to do something specific when it shuts down.
The only way I can debug this is doing a remote debugging session to the target machine. But in this mode, if I quit the terminal that it opens or stop it from the Xojo IDE, it just kills the app. The closed event never fires and no destructor code is fired.

How can I gracefully quit an app?

Can you not just put a button on the page and call quit?

2 Likes

And so it doesn’t appear in a built app, put this in the button’s Open event:

#if not debugbuild 
Me.Close
#endif
1 Like

wouldn’t that immediately quit the app on launch?
did you mean

#if DebugBuild
me.close
#endif

?

This is the example being suggested by James & Greg. A WebButton that calls App.Quit when pressed, but that won’t be shown if the app is not running in Debug mode (just in case):

app-quit.xojo_binary_project.zip (8.3 KB)

1 Like

Regarding all this… this quit button is a great way to get the app to quit cleanly when you’re using the profiler.

1 Like