forked from qt-creator/qt-creator
TextEditor: Use invokeMethod instead of singleShot timer with 0 delay
Use QCoreApplication::instance() as a context object for the IAssistProposal deleter. Change-Id: Idf8cd1955dca146a500da1ea036298455c8a5da1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -254,7 +254,9 @@ void CodeAssistantPrivate::requestProposal(AssistReason reason,
|
||||
case IAssistProvider::Asynchronous: {
|
||||
processor->setAsyncCompletionAvailableHandler([this, reason, processor](IAssistProposal *newProposal) {
|
||||
// do not delete this processor directly since this function is called from within the processor
|
||||
QTimer::singleShot(0, [processor]() { delete processor; });
|
||||
QMetaObject::invokeMethod(QCoreApplication::instance(), [processor]() {
|
||||
delete processor;
|
||||
}, Qt::QueuedConnection);
|
||||
if (processor != m_asyncProcessor)
|
||||
return;
|
||||
invalidateCurrentRequestData();
|
||||
|
||||
Reference in New Issue
Block a user