mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
207 stars 122 forks source link

ImageInfoWidget has been deleted error #37613

Open robertapplin opened 5 days ago

robertapplin commented 5 days ago

Describe the bug The following error can be made to occur:

Traceback (most recent call last):
  File "/home/mlc47243/mambaforge/envs/mantid_rc2/lib/python3.10/site-packages/matplotlib/cbook/__init__.py", line 314, in process
    func(*args, **kwargs)
  File "/home/mlc47243/mambaforge/envs/mantid_rc2/lib/python3.10/site-packages/mantidqt/widgets/sliceviewer/views/cursor.py", line 57, in on_mouse_leave
    self.on_cursor_outside_axes()
  File "/home/mlc47243/mambaforge/envs/mantid_rc2/lib/python3.10/site-packages/mantidqt/widgets/sliceviewer/presenters/imageinfowidget.py", line 67, in on_cursor_outside_axes
    self._widget.cursorAt(DBLMAX, DBLMAX, DBLMAX, extra_cols)
RuntimeError: wrapped C/C++ object of type ImageInfoWidget has been deleted

To Reproduce

For example

  1. Load the MAR11015 dataset
  2. Load SXD23767 from the training course data
  3. Right click "SXD23767" workspace and Show Slice Viewer
  4. Draw a square with the default tool (I think its the magnify glass)
  5. Click X in the top right to close the slice viewer
  6. Double click MAR11015 and plot the 1st spectrum
  7. Hover mouse over the plot. There error should occur!

Expected behavior No error should occur

Screenshots image Platform/Version (please complete the following information):

adriazalvarez commented 5 days ago

I was able to reproduce on windows. It seems to be reproducible when magnifying the plot, if moving the mouse out of the slice viewer gui before the new axes are computed and rendered, and then closing the GUI. Opening a spectrum on any other workspace would give the same error.