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:
@@ -51,7 +51,6 @@
|
||||
#include <QScrollBar>
|
||||
#include <QStringList>
|
||||
#include <QTextCodec>
|
||||
#include <QTimer>
|
||||
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/icore.h>
|
||||
@@ -1014,7 +1013,8 @@ void TextDocument::removeMarkFromMarksCache(TextMark *mark)
|
||||
auto scheduleLayoutUpdate = [documentLayout](){
|
||||
// make sure all destructors that may directly or indirectly call this function are
|
||||
// completed before updating.
|
||||
QTimer::singleShot(0, documentLayout, &QPlainTextDocumentLayout::requestUpdate);
|
||||
QMetaObject::invokeMethod(documentLayout, &QPlainTextDocumentLayout::requestUpdate,
|
||||
Qt::QueuedConnection);
|
||||
};
|
||||
|
||||
if (d->m_marksCache.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user