Selecting debug on the app.run allows for auto reloading. So the whole codebase runs again, and it didnt close the cam, this is supposed to be for code edits but I found it just did it all the time.
In theory moving the init to the main bit should stop it, it doesnt.
I have an init function that checks if the picam var is nothing, if so it sets it, otherwise does nothing, as its been set already. This works.
As does setting the debug to false.