Quit the engine when the surface is closed