Skip to content

Commit

Permalink
Fix potential race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Inokinoki authored and albertvaka committed Aug 6, 2023
1 parent e765fa5 commit 621ae3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/dbushelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ void DBusInstancePrivate::launchDBusDaemon()
m_dbusProcess->setStandardOutputFile(KdeConnectConfig::instance().privateDBusAddressPath());
m_dbusProcess->setStandardErrorFile(QProcess::nullDevice());
m_dbusProcess->start();
m_dbusProcess->waitForStarted(); // Avoid potential racing condition

#ifdef Q_OS_MAC
// Set launchctl env
Expand Down
2 changes: 2 additions & 0 deletions indicator/indicatorhelper_mac.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ int IndicatorHelper::daemonHook(QProcess &kdeconnectd)
"KDE Connect will quit"),
QMessageBox::Abort,
QMessageBox::Abort);
// End the program
return -1;
} else {
// Show a warning and exit
qCritical() << "Fail to get launchctl" << KDECONNECT_SESSION_DBUS_LAUNCHD_ENV << "env";
Expand Down

0 comments on commit 621ae3e

Please sign in to comment.