diff --git a/src/plugins/cppeditor/cppeditor.cpp b/src/plugins/cppeditor/cppeditor.cpp
index 8998fa3aa57fa3dcf897be61eb717cccffae9c42..c32b2320042c8c1df57388b12ec15097eb5ea4f4 100644
--- a/src/plugins/cppeditor/cppeditor.cpp
+++ b/src/plugins/cppeditor/cppeditor.cpp
@@ -2306,7 +2306,7 @@ void CPPEditorWidget::onFunctionDeclDefLinkFound(QSharedPointer<FunctionDeclDefL
     // disable the link if content of the target editor changes
     TextEditor::BaseTextEditorWidget *targetEditor =
             TextEditor::RefactoringChanges::editorForFile(link->targetFile->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()));
     }