Page MenuHomePhabricator

DataNode uses itkCloneMacro(Self) but does not implement a clone method
Closed, ResolvedPublic


DataNode uses itkCloneMacro(Self) but does not implement the InternalClone methods. Therefore using Clone() defaults to itk::LightObject::InternalClone, thus a nwe instance is created.

Either we should allow cloning but then implement it correctly (with a specific DataNode::InternalClone) or we should not allow it at all.

Revisions and Commits

Restricted Differential Revision
Restricted Differential Revision

Event Timeline

floca triaged this task as High priority.May 8 2020, 11:48 AM

Discussion results: check in our code base of someone uses the method. If not: Just remove it. If Yes: Look how they used/need it.

floca added subscribers: franza, seitela.

I have now removed the dysfunctional Clone for now. See D303

The only usages that I have found in the code base where in IGT:

  • QmitkUltrasoundCalibration::OnStartCalibrationProcess()
  • mitk::NavigationTool::NavigationTool(const NavigationTool &other)

I have replaced them with new()/CreatAnother() because this it was Clone() currently was doing.
@seitela @franza : I think it would be good if some one from IGT would check somewhen if there is maybe slumbering an error for long, because you had realy expected a clone (e.g. copied properties, which was never done). If so this could cause new tasks to emerge.