Page MenuHomePhabricator

Workbench crashes during reload of scene that contains a planar figure
Closed, ResolvedPublic


Steps to reproduce:

  • Load image
  • Open Measurement view
  • Draw line
  • Save scene
  • Close project
  • Load scene

--> Workbench crash!

  • Open workbench again
  • Load scene

--> No crash!

Event Timeline

The workbench crashes as soon as the mouse is moved in one of the render windows after the instruction above were followed. So, there's something going on the the interactor(s).

User kislinsk has pushed new remote branch:


In fact, the fix of T19329 did brake more than it actually fixed. It's
also the cause for T19627. The problem is the newly introduced
DeletedNode method (horrible name for what it is actually doing!) in
DataInteractor or to be more precise the call to this method in
Dispatcher::RemoveDataInteractor() and therefore also in
Dispatcher::AddDataInteractor(). You cannot safely add a data node to the
data storage anymore, that already has attached an interactor. For example,
if you listen in your plugin for the NodeAdded event and attach your
interactor there, this will fail when the Dispatcher's turn for this event
is still pending. That's the case for the measurement plugin, when it is
alrady opened at program start. In debug mode this leads to crashes! The
dispatcher deletes the interactor that was just added.

Removing the call to DataInteractor::DeletedNode from
Dispatcher::RemoveDataInteractor will fix the crashes but leads to dangling
references to the interactors which is the original problem described in bug

[163480]: Merge branch 'bug-19627-CrashOnMouseMoveAfterReloadOfPlanarFigureScene

Merged commits:

2016-04-05 17:31:41 Stefan Kislinskiy [20c285]
Adapt code to interactor weak pointer changes (previous commit)

2016-04-05 17:30:28 Stefan Kislinskiy [b81278]
Use data node weak pointers in interactors and interactor weak pointers in dispatcher

2016-03-23 18:59:15 Stefan Kislinskiy [d43262]
Clean-up measurement view and use smart pointers

There were several issues that boiled down to cyclic smart pointer dependencies between DataNode and DataInteractor, as well as smart pointer references to DataInteractor in Dispatcher. I replaced these reference counting pointers to weak pointers, as the one and only owner of a DataInteractor is the DataNode.

Breaking changes of public interfaces in the core:

mitk::DataInteractor::Get/SetDataNode() methods use raw DataNode pointers now.
mitk::DataInteractor::NodeType was removed.

User goch has pushed new remote branch:


[804984]: Merge branch 'bug-19627-adapt-simulation-module'

Merged commits:

2016-04-05 19:33:47 Caspar Goch [9aa425]
COMP: Adapt simulation module to core changes