forked from qt-creator/qt-creator
C++: Fix dangling IDocument* in CppCompletionAssistProcessor
Steps to reproduce the crash: 1. Open some long file, e.g. botan.cpp 2. Trigger completion and close editor immediately The IDocument pointer was only used to reference the file name. Instead of passing an IDocument* to the IAssistInterface, pass the file name. Change-Id: Iafce9b818806a77968a10541114bc9b7c8665f11 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: David Schulz <david.schulz@digia.com>
This commit is contained in:
@@ -6681,7 +6681,7 @@ IAssistInterface *BaseTextEditorWidget::createAssistInterface(AssistKind kind,
|
||||
AssistReason reason) const
|
||||
{
|
||||
Q_UNUSED(kind);
|
||||
return new DefaultAssistInterface(document(), position(), d->m_document.data(), reason);
|
||||
return new DefaultAssistInterface(document(), position(), d->m_document->fileName(), reason);
|
||||
}
|
||||
|
||||
QString TextEditor::BaseTextEditorWidget::foldReplacementText(const QTextBlock &) const
|
||||
|
||||
Reference in New Issue
Block a user