@on_trait_change('window:closed')
    def _on_window_closed(self, obj, trait_name, old, new):
        if trait_name == 'closed':
            self.stop()
We stop the engine when the window is closed.
dataset/ETHPy150Open enthought/mayavi/mayavi/plugins/envisage_engine.py/EnvisageEngine._on_window_closed