Commit 14f33bf9 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Fix closing a doc causes a crash sometimes

parent d5aeee56
......@@ -242,13 +242,10 @@ bool KateDocManager::closeDocuments(const QList<KTextEditor::Document *> &docume
// really delete the document and its infos
m_docInfos.erase(doc);
auto it = std::find(m_docList.begin(), m_docList.end(), doc);
if (it != m_docList.end()) {
delete *it;
// document is gone, emit our signals
Q_EMIT documentDeleted(doc);
m_docList.erase(it);
}
delete m_docList.takeAt(m_docList.indexOf(doc));
// document is gone, emit our signals
Q_EMIT documentDeleted(doc);
last++;
}
......
......@@ -190,10 +190,7 @@ void KateViewSpace::tabBarToggled()
KTextEditor::View *KateViewSpace::createView(KTextEditor::Document *doc)
{
// should only be called if a view does not yet exist
{
auto it = m_docToView.find(doc);
Q_ASSERT(it == m_docToView.end());
}
Q_ASSERT(m_docToView.find(doc) == m_docToView.end());
/**
* Create a fresh view
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment