From 1fd635dba4ddf827fca436843dfb01b3ecbff983 Mon Sep 17 00:00:00 2001 From: Sam Tygier Date: Wed, 25 Aug 2021 17:07:29 +0100 Subject: [PATCH] Fix segfault due to ViewBox deletetion in CompareSlicesView Use graveyard to prevent deletion --- docs/release_notes/next.rst | 1 + mantidimaging/gui/dialogs/cor_inspection/recon_slice_view.py | 3 +++ mantidimaging/gui/test/test_gui_system_reconstruction.py | 5 +---- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/release_notes/next.rst b/docs/release_notes/next.rst index cd8d47e3a39..dbdae19a94e 100644 --- a/docs/release_notes/next.rst +++ b/docs/release_notes/next.rst @@ -54,6 +54,7 @@ Fixes - #940: Ops window, pixel value not updating for part of image - #1093: TIFF output blank if NaN in stack - #1095: AttributeError loading 180 deg projection +- #1110: Segmentation fault COR table refine Developer Changes ----------------- diff --git a/mantidimaging/gui/dialogs/cor_inspection/recon_slice_view.py b/mantidimaging/gui/dialogs/cor_inspection/recon_slice_view.py index c533b27a60e..f45bcd8bd55 100644 --- a/mantidimaging/gui/dialogs/cor_inspection/recon_slice_view.py +++ b/mantidimaging/gui/dialogs/cor_inspection/recon_slice_view.py @@ -13,6 +13,8 @@ if TYPE_CHECKING: from mantidimaging.gui.dialogs.cor_inspection import CORInspectionDialogView # pragma: no cover +graveyard = [] + class CompareSlicesView(GraphicsLayoutWidget): less_img: ImageItem @@ -124,6 +126,7 @@ def image_in_vb(name=None) -> Tuple[ImageItem, ViewBox, HistogramLUTItem]: vb = ViewBox(invertY=True, lockAspect=True, name=name) vb.addItem(im) hist = HistogramLUTItem(im) + graveyard.append(vb) return im, vb, hist def set_image(self, image_type: ImageType, recon_data: np.ndarray, title: str): diff --git a/mantidimaging/gui/test/test_gui_system_reconstruction.py b/mantidimaging/gui/test/test_gui_system_reconstruction.py index 80380299d45..0f92e4d8a73 100644 --- a/mantidimaging/gui/test/test_gui_system_reconstruction.py +++ b/mantidimaging/gui/test/test_gui_system_reconstruction.py @@ -1,8 +1,6 @@ # Copyright (C) 2021 ISIS Rutherford Appleton Laboratory UKRI # SPDX - License - Identifier: GPL-3.0-or-later -import pytest - from PyQt5.QtTest import QTest from PyQt5.QtCore import Qt, QTimer @@ -67,9 +65,8 @@ def test_refine(self): QTest.qWait(SHOW_DELAY) - @pytest.mark.skip(reason="Triggers #1110") def test_refine_stress(self): - for i in range(20): + for i in range(5): print(f"test_refine_stress iteration {i}") QTest.mouseClick(self.recon_window.correlateBtn, Qt.MouseButton.LeftButton) QTest.qWait(SHORT_DELAY)