From a82c47d3079dab568f56098e3c74162852d9e561 Mon Sep 17 00:00:00 2001 From: Nikolai Kosjar Date: Thu, 20 Jul 2017 16:35:55 +0200 Subject: [PATCH] CppEditor: Remove invalid QTC_ASSERT This can be triggered by: 1. Put the cursor on some identifier 2. Type some e.g. a-z character and trigger Ctrl+Shift+R as fast as possible Typing the characters modifies the document and triggers the CppUseSelectionsUpdater asynchronously. The result comes in when we are already in local renaming mode, thus the assert triggers. Change-Id: I4ae7b2b4c259b3b1ef637f5272b0bda06b6db2ec Reviewed-by: David Schulz --- src/plugins/cppeditor/cpplocalrenaming.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cppeditor/cpplocalrenaming.cpp b/src/plugins/cppeditor/cpplocalrenaming.cpp index d14a5832f2b..fd989c782c8 100644 --- a/src/plugins/cppeditor/cpplocalrenaming.cpp +++ b/src/plugins/cppeditor/cpplocalrenaming.cpp @@ -70,7 +70,9 @@ CppLocalRenaming::CppLocalRenaming(TextEditor::TextEditorWidget *editorWidget) void CppLocalRenaming::updateSelectionsForVariableUnderCursor( const QList &selections) { - QTC_ASSERT(!isActive(), return); + if (isActive()) + return; + m_selections = selections; }