Skip to content

Commit

Permalink
Fix segfault due to ViewBox deletetion in CompareSlicesView
Browse files Browse the repository at this point in the history
Use graveyard to prevent deletion
  • Loading branch information
samtygier-stfc committed Aug 25, 2021
1 parent 8edc8f7 commit 1fd635d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/release_notes/next.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----------------
Expand Down
3 changes: 3 additions & 0 deletions mantidimaging/gui/dialogs/cor_inspection/recon_slice_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down
5 changes: 1 addition & 4 deletions mantidimaging/gui/test/test_gui_system_reconstruction.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 1fd635d

Please sign in to comment.