1
0
forked from pool/libqt5-qtbase
libqt5-qtbase/00010-Replace-the-const-QString-global-static-with-a-QStri.patch
Stephan Kulow 74642d42fc Accepting request 240084 from KDE:Qt5
- Added 00010-Replace-the-const-QString-global-static-with-a-QStri.patch,
  fixes segfaulting in global destructor, for more details see:
  http://mail.kde.org/pipermail/kde-frameworks-devel/2014-June/017086.html
- Added 00011-Use-correct-signal-name-when-disconnecting.patch,
  fixes crash on QtDBus unload

OBS-URL: https://build.opensuse.org/request/show/240084
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/libqt5-qtbase?expand=0&rev=23
2014-07-13 12:05:56 +00:00

50 lines
1.7 KiB
Diff

From eda5c8ede9fd35117146d13f1b55775c9007b672 Mon Sep 17 00:00:00 2001
From: Thiago Macieira <thiago.macieira@intel.com>
Date: Mon, 30 Jun 2014 08:31:22 -0700
Subject: [PATCH 1/1] Replace the const QString global static with a
QStringLiteral
It was originally created to avoid allocating memory for the QString at
every turn, but we have QStringLiteral for that today. It has also
served a very good run by catching qatomic.h implementations that had
bad cv qualifications.
Change-Id: Id6d952b8cce363015ec2611d346b4cccedecf137
---
src/dbus/qdbusintegrator.cpp | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index d4079e8..bc28d50 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -76,15 +76,21 @@ QT_BEGIN_NAMESPACE
static QBasicAtomicInt isDebugging = Q_BASIC_ATOMIC_INITIALIZER(-1);
#define qDBusDebug if (::isDebugging == 0); else qDebug
-Q_GLOBAL_STATIC_WITH_ARGS(const QString, orgFreedesktopDBusString, (QLatin1String(DBUS_SERVICE_DBUS)))
+QString orgFreedesktopDBusString()
+{
+ return QStringLiteral(DBUS_SERVICE_DBUS);
+}
static inline QString dbusServiceString()
-{ return *orgFreedesktopDBusString(); }
+{
+ return orgFreedesktopDBusString();
+}
+
static inline QString dbusInterfaceString()
{
// it's the same string, but just be sure
- Q_ASSERT(*orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS));
- return *orgFreedesktopDBusString();
+ Q_ASSERT(orgFreedesktopDBusString() == QLatin1String(DBUS_INTERFACE_DBUS));
+ return orgFreedesktopDBusString();
}
static inline QDebug operator<<(QDebug dbg, const QThread *th)
--
1.8.4.5