Skip to content

Commit

Permalink
Merge branch 'jb52659' into 'mer-5.6'
Browse files Browse the repository at this point in the history
[qtbase] Fix crash on exit when there are pending dbus calls. Contributes to JB#52659

See merge request mer-core/qtbase!76
  • Loading branch information
adenexter committed Feb 18, 2021
2 parents 0f928e0 + e79c6d3 commit e1ae027
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/dbus/qdbusconnection.cpp
Expand Up @@ -68,6 +68,16 @@ static void preventDllUnload();

Q_GLOBAL_STATIC(QDBusConnectionManager, _q_manager)

static void shutdownConnectionManager()
{
if (_q_manager.exists()) {
auto manager = _q_manager();

manager->quit();
manager->wait();
}
}

struct QDBusConnectionManager::ConnectionRequestData
{
enum RequestType {
Expand Down Expand Up @@ -142,12 +152,12 @@ QDBusConnectionManager::QDBusConnectionManager()
#endif
defaultBuses[0] = defaultBuses[1] = Q_NULLPTR;
start();

qAddPostRoutine(shutdownConnectionManager);
}

QDBusConnectionManager::~QDBusConnectionManager()
{
quit();
wait();
}

QDBusConnectionManager* QDBusConnectionManager::instance()
Expand Down

0 comments on commit e1ae027

Please sign in to comment.