Page MenuHomePhabricator

[Segmentation] Workbench crashes when closing render window part with active tool
Open, Unbreak Now!Public

Description

The workbench crashes if a segmentation tool is active and the workbench is closed.
This happens because the ActiveToolChanged is called if the active tool changes. The destructor of the Segmentation View is called when the workbench is closed and the tool active tool is deactivated.
At that time the render window part is not available anymore and the access to this class instance inside QmitkSegmentationView::ActiveToolChanged leads to a crash.

To reproduce:

  1. open MITK, load an image
  2. close the Standard Display, open the MxN Display
  3. open the segmentation plugin view and create a new segmentation node
  4. activate a tool and close the workbench via "x"

Event Timeline

kalali triaged this task as Normal priority.Apr 19 2023, 6:45 PM
kalali created this task.

In general this might be a problem also for other views because closing the workbench removes the render window part listener: m_RenderWindowListeners.remove(renderWindowListener) in QmitkViewCoordinator::PartClosed. This leads to the issue that the Segmentation view does not listen to the render window part being closed anymore.
Thus in the current scenario the render window part is NOT set to nullptr in the Segmentation view and in turn an invalid access is made when destroying the Segmentation view.

kalali edited projects, added MITK (v2023.04); removed MITK.
kalali moved this task from Backlog to Cycle on the MITK (v2023.04) board.
kalali moved this task from Cycle to mxn MultiWidget on the MITK (v2023.04) board.
floca raised the priority of this task from Normal to Unbreak Now!.Tue, Apr 2, 7:12 PM
floca added a project: Request for Discussion.
floca added a subscriber: floca.

Discussion: How important is that?

Yes, this still happens as described above.