forked from qt-creator/qt-creator
C++: fix crash when failing to open non-existing file.
Change-Id: Ie7bd3b36139ab7fac1186cefa7222dff7277eb53 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
2ddb726dd5
commit
feff33827c
@@ -245,10 +245,6 @@ CppModelManager::CppModelManager(QObject *parent)
|
||||
|
||||
qRegisterMetaType<CPlusPlus::Document::Ptr>("CPlusPlus::Document::Ptr");
|
||||
|
||||
// Listen for editor closed events so that we can keep track of changing files
|
||||
connect(Core::ICore::editorManager(), SIGNAL(editorAboutToClose(Core::IEditor*)),
|
||||
this, SLOT(editorAboutToClose(Core::IEditor*)));
|
||||
|
||||
m_completionFallback = new InternalCompletionAssistProvider;
|
||||
m_completionAssistProvider = m_completionFallback;
|
||||
ExtensionSystem::PluginManager::addObject(m_completionAssistProvider);
|
||||
@@ -602,14 +598,13 @@ QList<ProjectPart::Ptr> CppModelManager::projectPart(const QString &fileName) co
|
||||
}
|
||||
|
||||
/// \brief Removes the CppEditorSupport for the closed editor.
|
||||
void CppModelManager::editorAboutToClose(Core::IEditor *editor)
|
||||
void CppModelManager::deleteEditorSupport(TextEditor::BaseTextEditor *textEditor)
|
||||
{
|
||||
if (!isCppEditor(editor))
|
||||
return;
|
||||
|
||||
TextEditor::BaseTextEditor *textEditor = qobject_cast<TextEditor::BaseTextEditor *>(editor);
|
||||
QTC_ASSERT(textEditor, return);
|
||||
|
||||
if (!isCppEditor(textEditor))
|
||||
return;
|
||||
|
||||
QMutexLocker locker(&m_editorSupportMutex);
|
||||
CppEditorSupport *editorSupport = m_editorSupport.value(textEditor, 0);
|
||||
m_editorSupport.remove(textEditor);
|
||||
|
Reference in New Issue
Block a user