From 2bcbe227bdcfded9ae01b289e78aa9e117613056 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 13 Apr 2015 22:22:10 -0700 Subject: 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 --- src/dbus/qdbusintegrator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/dbus/qdbusintegrator.cpp') 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); } -- cgit v1.2.3