[Interest] QDBusConnection::sessionBus() in widget style dtor (QCommonStyle::~QCommonStyle())

René J.V. Bertin rjvbertin at gmail.com
Wed Apr 26 14:51:41 CEST 2017


I'm looking once more into a long-standing issue with a widget style (QtCurve; https://bugs.kde.org/show_bug.cgi?id=363753) where certain applications using it crash at exit.

The sequence leading to the crash is: QtCurve's Style dtor attempts to disconnect from the D-Bus, calls QDBusConnection::sessionBus() for that purpose, which then attempts to invoke a method of a stale QDBusConnection instance (this=NULL in the backtrace).

It's probably a bug (and sloppy at best) that Qt allows this to happen, but maybe there are guidelines that QtCurve doesn't follow? I noticed that the instance returned by sessionBus() is deleted in the QCoreApplication dtor. Should we maybe do the DBus disconnect in reaction to the QCoreApplication::aboutToQuit signal?


More information about the Interest mailing list