TextEditor: Fix possible crash

Change-Id: I37074051f5fb498c3c074026b8ec7b65c1df3da2
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Stenger
2018-11-23 10:02:29 +01:00
committed by David Schulz
parent 9ee5cab4ae
commit 49f8f050df

View File

@@ -76,10 +76,14 @@ void BaseHoverHandler::contextHelpId(TextEditorWidget *widget,
{
// If the tooltip is visible and there is a help match, this match is used to update
// the help id. Otherwise, let the identification process happen.
if (!Utils::ToolTip::isVisible() || !lastHelpItemIdentified().isValid())
process(widget, pos, [this, widget, callback](int) { propagateHelpId(widget, callback); });
else
if (!Utils::ToolTip::isVisible() || !lastHelpItemIdentified().isValid()) {
process(widget, pos, [this, widget = QPointer<TextEditorWidget>(widget), callback](int) {
if (widget)
propagateHelpId(widget, callback);
});
} else {
propagateHelpId(widget, callback);
}
}
void BaseHoverHandler::setToolTip(const QString &tooltip)