qt6-bb10/src/dbus
Thiago Macieira 58d9b42c03 Fix deadlock on disconnectNotify() called from ~QObject
Normally, disconnectNotify() is called at the end of QObject::disconnect
and all the locks have been dropped. That is not the case for the
QObject destructor, so we need to deal with the fact that it there may
be some locks held.

I didn't catch this issue during testing because it depends on the
pointer addresses of the object being destroyed and that of the
QDBusAbstractInterface sender object, as we use one global, non-
recursive mutex pool. For the same reason, this patch is not testable.

The fix is simple: we don't need to remove the relay rules immediately.
It's ok for them to happen later, since the worst case scenario is that
we'll receive a few more signals than we have objects to deliver them
to. If that happens, we'll do a little more work than we have to. But in
the normal case, the amount of work is the same and we get the benefit
of returning more quickly from the destructor. What's more, if the
QDBusAbstractInterface object also gets destroyed, the events are
deleted and QDBusConnectionPrivate will clean everything up.

Task-number: QTBUG-48410
Change-Id: I42e7ef1a481840699a8dffff1406b789ba5217b3
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2015-09-25 07:45:06 +00:00
..
doc Updated BSD licensed file headers 2015-02-15 07:41:17 +00:00
Qt5DBusConfigExtras.cmake.in Check that files we expect to find actually exist when using a cmake package. 2013-05-20 15:20:26 +02:00
Qt5DBusMacros.cmake Updated BSD licensed file headers 2015-02-15 07:41:17 +00:00
dbus.pro fix usage of wince scope 2015-06-05 10:29:10 +00:00
dbus_minimal_p.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbus_symbols.cpp dbus: allow dbus_shutdown() on QT_NO_LIBRARY && QT_LINKED_LIBDBUS 2015-07-06 14:15:53 +00:00
qdbus_symbols_p.h Implement the blocking QtDBus call in terms of the non-blocking one 2015-09-15 02:08:34 +00:00
qdbusabstractadaptor.cpp dbus: Use QList::reserve(), reduces reallocations. 2015-06-23 12:46:36 +00:00
qdbusabstractadaptor.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusabstractadaptor_p.h QtDBus: mark QDBusAdaptorConnector::AdaptorData as primitive 2015-07-08 12:30:55 +00:00
qdbusabstractinterface.cpp Fix deadlock on disconnectNotify() called from ~QObject 2015-09-25 07:45:06 +00:00
qdbusabstractinterface.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusabstractinterface_p.h Fix deadlock on disconnectNotify() called from ~QObject 2015-09-25 07:45:06 +00:00
qdbusargument.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusargument.h QDBusArgument: declare as shared-come-Qt6 2015-07-18 13:32:53 +00:00
qdbusargument_p.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusconnection.cpp Make sure we don't deadlock when connecting signals 2015-09-15 02:08:57 +00:00
qdbusconnection.h QDBusConnection: declare as shared-come-Qt6 2015-07-19 10:33:23 +00:00
qdbusconnection_p.h Merge two more QDBusConnectionPrivate members into a union 2015-09-15 02:09:01 +00:00
qdbusconnectioninterface.cpp Use QStringLiteral where applicable in QtDBus 2015-03-31 06:50:42 +00:00
qdbusconnectioninterface.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusconnectionmanager_p.h Merge two Q_GLOBAL_STATICS into another and solve memory leak 2015-09-15 02:08:47 +00:00
qdbuscontext.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbuscontext.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbuscontext_p.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusdemarshaller.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbuserror.cpp QDBusError: Disable function that isn't used in bootstrapped builds 2015-08-06 07:34:20 +00:00
qdbuserror.h QDBusError: declare as shared-come-Qt6 2015-07-18 13:32:59 +00:00
qdbusextratypes.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusextratypes.h Mark QDBus{ObjectPath,Signature,Variant} shared-come-qt6 2015-07-19 18:13:37 +00:00
qdbusintegrator.cpp Fix deadlock on disconnectNotify() called from ~QObject 2015-09-25 07:45:06 +00:00
qdbusintegrator_p.h Remove the event callbacks in QDBusConnectionPrivate 2015-09-15 02:08:48 +00:00
qdbusinterface.cpp dbus: Use QList::reserve(), reduces reallocations. 2015-06-23 12:46:36 +00:00
qdbusinterface.h QtDBus: Use Q_NULLPTR instead of 0 in all public headers 2015-07-04 06:03:29 +00:00
qdbusinterface_p.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusinternalfilters.cpp QDBusConnection::registorObject with interface 2015-02-15 02:17:53 +00:00
qdbusintrospection.cpp Remove documentation of QDBusIntrospection::Object::introspection. 2015-02-25 11:36:38 +00:00
qdbusintrospection_p.h Remove Q_DECLARE_TYPEINFO that causes a build error 2015-08-22 22:26:16 +00:00
qdbusmacros.h Remove <qhash.h> where it's not used 2015-04-20 07:41:34 +00:00
qdbusmarshaller.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusmessage.cpp Merge remote-tracking branch 'origin/5.5' into dev 2015-04-01 09:10:26 +02:00
qdbusmessage.h QDBusMessage: declare as shared-come-Qt6 2015-07-18 13:33:04 +00:00
qdbusmessage_p.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusmetaobject.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusmetaobject_p.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusmetatype.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusmetatype.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusmetatype_p.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusmisc.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbuspendingcall.cpp Implement the blocking QtDBus call in terms of the non-blocking one 2015-09-15 02:08:34 +00:00
qdbuspendingcall.h QtDBus: Use Q_NULLPTR instead of 0 in all public headers 2015-07-04 06:03:29 +00:00
qdbuspendingcall_p.h Implement the blocking QtDBus call in terms of the non-blocking one 2015-09-15 02:08:34 +00:00
qdbuspendingreply.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbuspendingreply.h Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusreply.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusreply.h QtDBus: Use Q_NULLPTR instead of 0 in all public headers 2015-07-04 06:03:29 +00:00
qdbusserver.cpp And move the creation of connections to the thread 2015-09-15 02:08:45 +00:00
qdbusserver.h And move the creation of connections to the thread 2015-09-15 02:08:45 +00:00
qdbusservicewatcher.cpp QDBusServiceWatcher: Move the logic to QDBusConnectionPrivate 2015-09-15 02:08:50 +00:00
qdbusservicewatcher.h QDBusServiceWatcher: Move the logic to QDBusConnectionPrivate 2015-09-15 02:08:50 +00:00
qdbusthreaddebug_p.h And move the sending of other types of D-Bus messages to the thread 2015-09-15 02:08:43 +00:00
qdbusunixfiledescriptor.cpp Doc:added doc to undocumented functions 2015-07-22 13:47:23 +00:00
qdbusunixfiledescriptor.h QtDBus: make all Q_DECLARE_SHARED types nothrow move-assignable 2015-06-30 10:57:27 +00:00
qdbusutil.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusutil_p.h Use QStringLiteral where applicable in QtDBus 2015-03-31 06:50:42 +00:00
qdbusvirtualobject.cpp Doc: added doc for non-documented functions 2015-05-18 08:01:37 +00:00
qdbusvirtualobject.h QtDBus: Use Q_NULLPTR instead of 0 in all public headers 2015-07-04 06:03:29 +00:00
qdbusxmlgenerator.cpp Skip non-exported slots early when creating a XML interface description. 2015-03-25 10:11:51 +00:00
qdbusxmlparser.cpp Update copyright headers 2015-02-11 06:49:51 +00:00
qdbusxmlparser_p.h Update copyright headers 2015-02-11 06:49:51 +00:00