diff --git a/mantidimaging/gui/windows/live_viewer/view.py b/mantidimaging/gui/windows/live_viewer/view.py index 2f76f298a91..e9aa5836a7e 100644 --- a/mantidimaging/gui/windows/live_viewer/view.py +++ b/mantidimaging/gui/windows/live_viewer/view.py @@ -88,11 +88,8 @@ def set_image_index(self, index: int) -> None: def closeEvent(self, e) -> None: """Close the window and remove it from the main window list""" - for live_viewer in self.main_window.live_viewer_list: - if live_viewer.path == self.path: - if live_viewer.presenter: - live_viewer.presenter.close() - live_viewer.close() + self.main_window.live_viewer_list.remove(self) + self.presenter.close() self.live_viewer.handle_deleted() super().closeEvent(e) self.presenter = None # type: ignore # View instance to be destroyed -type can be inconsistent diff --git a/mantidimaging/gui/windows/main/view.py b/mantidimaging/gui/windows/main/view.py index 0d485c8f4f8..8aa2329f245 100644 --- a/mantidimaging/gui/windows/main/view.py +++ b/mantidimaging/gui/windows/main/view.py @@ -476,8 +476,8 @@ def live_view_choose_directory(self) -> None: def show_live_viewer(self, live_data_path: Path) -> None: live_viewer = LiveViewerWindowView(self, live_data_path) self.live_viewer_list.append(live_viewer) - self.live_viewer_list[-1].activateWindow() - self.live_viewer_list[-1].raise_() + # self.live_viewer_list[-1].activateWindow() + # self.live_viewer_list[-1].raise_() self.live_viewer_list[-1].show() @property @@ -562,7 +562,8 @@ def closeEvent(self, event) -> None: if self.recon: self.recon.close() if self.live_viewer_list: - [live_viewer.close() for live_viewer in self.live_viewer_list] + while self.live_viewer_list: + self.live_viewer_list[-1].close() if self.spectrum_viewer: self.spectrum_viewer.close() if self.filters: