summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-02-04 14:47:20 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-02-05 03:23:33 +0100
commitc3c2a0f75486b0dd10524219e99f6d88d023981c (patch)
tree2e36ef836f49e03d7b017fe3c2dee428d93d3d80 /src/dbus
parent7277ffee522bdf57128d292b02d2b127f5038bee (diff)
QDBusAdaptorConnector: place a static int into BSS instead of DATA
The cachedRelaySlotMethodIndex started out as -1, assuming no slot could have that index. But 0 is just as good a marker, because we know that method index 0 will be one of QObject's (destroyed() or deleteLater()). So start out with a zero initial value, which means the variable can be placed in the BSS segment now and doesn't need to be stored in DATA. Pick-to: 6.3 6.2 Change-Id: I40b96d54f11e60348f465cafa15af98d41038c95 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusabstractadaptor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/dbus/qdbusabstractadaptor.cpp b/src/dbus/qdbusabstractadaptor.cpp
index 8d99577929..d048ae2e52 100644
--- a/src/dbus/qdbusabstractadaptor.cpp
+++ b/src/dbus/qdbusabstractadaptor.cpp
@@ -58,13 +58,13 @@
QT_BEGIN_NAMESPACE
-static int cachedRelaySlotMethodIndex = -1;
+static int cachedRelaySlotMethodIndex = 0;
int QDBusAdaptorConnector::relaySlotMethodIndex()
{
- if (cachedRelaySlotMethodIndex == -1) {
+ if (cachedRelaySlotMethodIndex == 0) {
cachedRelaySlotMethodIndex = staticMetaObject.indexOfMethod("relaySlot()");
- Q_ASSERT(cachedRelaySlotMethodIndex != -1);
+ Q_ASSERT(cachedRelaySlotMethodIndex != 0); // 0 should be deleteLater() or destroyed()
}
return cachedRelaySlotMethodIndex;
}