summaryrefslogtreecommitdiffstats
path: root/src/dbus
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-04-13 22:22:10 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-04-15 00:07:05 +0000
commit2bcbe227bdcfded9ae01b289e78aa9e117613056 (patch)
tree891c73ad761a5851ae8b851f00f844bb96c6cb58 /src/dbus
parent91dfab223a64385f6c0d010deafbdc8b2eb69968 (diff)
Fix crashes on shutdown when the D-Bus spy list has been destroyed
The QDBusConnection spy hook is most often created after the QDBusConnectionManager global, which means it will get destroyed before. That means we'll almost surely going to get a null pointer dereference if we handle the socket close to shutdown. Change-Id: I27eaacb532114dd188c4ffff13d4c9dc865b8c02 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/dbus')
-rw-r--r--src/dbus/qdbusintegrator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
index 9eac1ed933..d05703d34d 100644
--- a/src/dbus/qdbusintegrator.cpp
+++ b/src/dbus/qdbusintegrator.cpp
@@ -554,7 +554,7 @@ qDBusSignalFilter(DBusConnection *connection, DBusMessage *message, void *data)
bool QDBusConnectionPrivate::handleMessage(const QDBusMessage &amsg)
{
const QDBusSpyHookList *list = qDBusSpyHookList();
- for (int i = 0; i < list->size(); ++i) {
+ for (int i = 0; list && i < list->size(); ++i) {
qDBusDebug() << "calling the message spy hook";
(*(*list)[i])(amsg);
}