forked from qt-creator/qt-creator
ClangCodeModel: Make VirtualFunctionAssistProcessor more safe
Let's not access the object state after emitting ClangdFollowSymbol::done(), in case the receiver deletes us. Can happen in test code. Change-Id: Ia6c691c0f88b16476da1a6be1cedd106d9da2d53 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -310,9 +310,10 @@ void ClangdFollowSymbol::VirtualFunctionAssistProcessor::resetData(bool resetFol
|
||||
if (!m_followSymbol)
|
||||
return;
|
||||
m_followSymbol->d->virtualFuncAssistProcessor = nullptr;
|
||||
if (resetFollowSymbolData)
|
||||
m_followSymbol->emitDone();
|
||||
ClangdFollowSymbol * const followSymbol = m_followSymbol;
|
||||
m_followSymbol = nullptr;
|
||||
if (resetFollowSymbolData)
|
||||
followSymbol->emitDone();
|
||||
}
|
||||
|
||||
IAssistProposal *ClangdFollowSymbol::VirtualFunctionAssistProcessor::createProposal(bool final)
|
||||
|
||||
Reference in New Issue
Block a user