as in (?):
    QHash::iterator it = m_types.find(typeString)
    if (it != m_types.end()) {
        close(it.value());
        m_types.erase(it);
    }

can do