diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp index 8998fa3aa57..c32b2320042 100644 --- a/src/plugins/cppeditor/cppeditor.cpp +++ b/src/plugins/cppeditor/cppeditor.cpp @@ -2306,7 +2306,7 @@ void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointertargetFile->fileName()); - if (targetEditor) { + if (targetEditor && targetEditor != this) { connect(targetEditor, SIGNAL(textChanged()), this, SLOT(abortDeclDefLink())); } @@ -2329,7 +2329,7 @@ void CPPEditorWidget::abortDeclDefLink() // undo connect from onFunctionDeclDefLinkFound TextEditor::BaseTextEditorWidget *targetEditor = TextEditor::RefactoringChanges::editorForFile(m_declDefLink->targetFile->fileName()); - if (targetEditor) { + if (targetEditor && targetEditor != this) { disconnect(targetEditor, SIGNAL(textChanged()), this, SLOT(abortDeclDefLink())); }