Issues with DataNode delete events and double deletions due to smart-pointer constructions popped up in this thread:
http://thread.gmane.org/gmane.comp.lib.mitk.user/5616
The main issue is that if a mitk::DataNode object is destroyed (last smart-pointer goes out of scope), the itk::Object fires a itk::DeleteEvent() which is routed through the event system in mitk::DataStorage. If a callback function calls itself methods on mitk::DataStorage using such a DataNode raw pointer, it is important that such mitk::DataStorage methods do not construct temporary smart pointers from the raw pointer since this would lead to double deletion.
One method not following this rule is
mitk::StandaloneDataStorage::GetRelations(const mitk::DataNode* node, const AdjacencyList& relation, const NodePredicateBase* condition, bool onlyDirectlyRelated) const
It implicitly constructs a temporary smart pointer e.g. by calling relation.find(node). All temporary smart pointers need to be avoided or the reference count needs to be managed manually.