From 041fae00351164fbd72763e4bd947fdeb9956a5d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 20 Aug 2015 14:22:13 -0700 Subject: [PATCH] Fix crash on exit caused by QStringLiterals These QStringLiterals are passed to QtDBus, which records them. They will be used even after the libQt5XcbQpa.so library is unloaded, which causes a crash on exit, one that even valgrind gets lost on. Change-Id: I7de033f80b0e4431b7f1ffff13fc4888e45a346a Reviewed-by: Albert Astals Cid Reviewed-by: Richard J. Moore Reviewed-by: Frederik Gladhorn --- .../linuxaccessibility/dbusconnection.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/platformsupport/linuxaccessibility/dbusconnection.cpp b/src/platformsupport/linuxaccessibility/dbusconnection.cpp index 637b06549a..ae1ba1819a 100644 --- a/src/platformsupport/linuxaccessibility/dbusconnection.cpp +++ b/src/platformsupport/linuxaccessibility/dbusconnection.cpp @@ -47,8 +47,11 @@ QT_BEGIN_NAMESPACE -QString A11Y_SERVICE = QStringLiteral("org.a11y.Bus"); -QString A11Y_PATH = QStringLiteral("/org/a11y/bus"); +/* note: do not change these to QStringLiteral; + we are unloaded before QtDBus is done using the strings. + */ +#define A11Y_SERVICE QLatin1String("org.a11y.Bus") +#define A11Y_PATH QLatin1String("/org/a11y/bus") /*! \class DBusConnection @@ -137,7 +140,7 @@ void DBusConnection::connectA11yBus(const QString &address) qWarning("Could not find Accessibility DBus address."); return; } - m_a11yConnection = QDBusConnection(QDBusConnection::connectToBus(address, QStringLiteral("a11y"))); + m_a11yConnection = QDBusConnection(QDBusConnection::connectToBus(address, QLatin1String("a11y"))); if (m_enabled) emit enabledChanged(true);