mitk::DataStorage::GetDerivations( ) returns an iternal pointer to the SetOfObjects. When Remove( ) is called with this set of objects, the loop over the list is not corretly done because the elements are removed while the loop is iterating.
Example code:
mitk::DataStorage::Pointer dataStorage;
mitk::DataTreeNode::Pointer rootNode;
(... Create a root node and 4 child nodes ...)
dataStorage->Remove( dataStorage->GetDerivations( rootNode ) );
Patch:
Modified mitk::DataStorage::FilterSetOfObjects() to always create a new list instead of returing the internal list.