Skip to content

Commit

Permalink
Don't create a threaded delay
Browse files Browse the repository at this point in the history
  • Loading branch information
mariogrip committed Oct 17, 2019
1 parent e2f4439 commit 468ec12
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions ofonocallchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,9 @@ void oFonoCallChannel::onOfonoCallStateChanged(const QString &state)
}
mCallChannel->setCallState(Tp::CallStateEnded, 0, reason, stateDetails);
// just in case, leave the channel opened for one more second before unregistering from bus
QTimer::singleShot(1000, [=]() {
Q_EMIT closed();
mBaseChannel->close();
});
QThread::msleep(1000);
Q_EMIT closed();
mBaseChannel->close();
} else if (state == "active") {
qDebug() << "active";
mHoldIface->setHoldState(Tp::LocalHoldStateUnheld, Tp::LocalHoldStateReasonNone);
Expand Down
5 changes: 2 additions & 3 deletions ofonoconferencecallchannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ void oFonoConferenceCallChannel::onChannelSplitted(const QDBusObjectPath &path)

mCallChannel->setCallState(Tp::CallStateEnded, 0, reason, stateDetails);
// just in case, delay the channel closing by 1 second
QTimer::singleShot(1000, [=]() {
mBaseChannel->close();
});
QThread::msleep(1000);
mBaseChannel->close();
}
}

Expand Down

0 comments on commit 468ec12

Please sign in to comment.