The crash was cauesd by the std:vector:back() method which was used when all elements in the vector were erased
bool mitk::FocusManager::RemoveElement(FocusElement* element)
{
// Try find mitk::FocusManager::FocusListIterator position = std::find(m_FocusList.begin(),m_FocusList.end(),element); if (position == m_FocusList.end()) return false; position = m_FocusList.erase(position); //first delete the one on the position, and store the one afterewards into position if (position == m_FocusList.end())//deleded was the last in row, then take the one before //m_FocElement = m_FocusList.back(); //this line was causing crash, after last element was erased you cant use back() method return false; else m_FocElement = *position;//m_FocElement is equal to the next one in row return true;
}