Is there a signal or virtual function that gets called when you "Stop" the editor? I assumed _exit_tree() would be called but that doesn't seem to be the case.
For clarification, I've got a little logger that I want to save the contents of to a text file when the scene is Stopped in the editor, but I can't seem to find any way of triggering code when the Stop button in the editor is clicked.