> if the render loop crashed, the value would never get set false, and you could never start a new loop

You could just make sure to clear the flag at the very top of render, before doing anything else.