Check for qApp before using it in ibus plugin

We might call updatePreeditText from the QCoreApplication dtor by
running an event loop from inside a "post routine" added with
qAddPostRoutine().

Task-number: QTBUG-60000
Change-Id: I04c08fe36bfa63ac345a06e50952d2ec83a78ac0
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
bb10
Ulf Hermann 2017-04-25 15:46:24 +02:00
parent b6ae2695af
commit 40fdc4f44c
1 changed files with 3 additions and 0 deletions

View File

@ -267,6 +267,9 @@ void QIBusPlatformInputContext::commitText(const QDBusVariant &text)
void QIBusPlatformInputContext::updatePreeditText(const QDBusVariant &text, uint cursorPos, bool visible)
{
if (!qApp)
return;
QObject *input = qApp->focusObject();
if (!input)
return;