Skip to content

BUG: Fixed scene view node memory leak


Solution in this patch:

  1. To prevent having a singleton and a non-singleton node in the scene with the same ID: When we look for a singleton node we check if we can find any non-singleton node that has an ID that matches the singleton node ID. If a non-singleton-node with a singleton ID is found then that non-singleton-node is converted to singleton and a warning is logged.
  2. To prevent logging a warning due to missing singleton tag: if the singleton node tag is missing for SceneViewTopLevel node then we add it in vtkSlicerSceneViewsModuleLogic.

A nicer solution would be to make a new class for SceneViewTopLevel node and set it as a singleton node in its constructor. However, we would still need to have the singleton node adding workaround for old scene files.

Merge request reports