Add recursion check to LogindIntegration::takeControl
We never want to call takeControl twice at the same time.
This commit is contained in:
parent
2a39e6290b
commit
26c44a6524
1 changed files with 6 additions and 0 deletions
|
@ -175,6 +175,11 @@ void LogindIntegration::takeControl()
|
||||||
if (!m_connected || m_sessionPath.isEmpty() || m_sessionControl) {
|
if (!m_connected || m_sessionPath.isEmpty() || m_sessionControl) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
static bool s_recursionCheck = false;
|
||||||
|
if (s_recursionCheck) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
s_recursionCheck = true;
|
||||||
|
|
||||||
QDBusMessage message = QDBusMessage::createMethodCall(s_login1Service,
|
QDBusMessage message = QDBusMessage::createMethodCall(s_login1Service,
|
||||||
m_sessionPath,
|
m_sessionPath,
|
||||||
|
@ -185,6 +190,7 @@ void LogindIntegration::takeControl()
|
||||||
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(session, this);
|
QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(session, this);
|
||||||
connect(watcher, &QDBusPendingCallWatcher::finished, this,
|
connect(watcher, &QDBusPendingCallWatcher::finished, this,
|
||||||
[this](QDBusPendingCallWatcher *self) {
|
[this](QDBusPendingCallWatcher *self) {
|
||||||
|
s_recursionCheck = false;
|
||||||
QDBusPendingReply<void> reply = *self;
|
QDBusPendingReply<void> reply = *self;
|
||||||
self->deleteLater();
|
self->deleteLater();
|
||||||
if (!reply.isValid()) {
|
if (!reply.isValid()) {
|
||||||
|
|
Loading…
Reference in a new issue