From 468ec122af5de90d14896a4396a7e5f8bae7adb0 Mon Sep 17 00:00:00 2001 From: Marius Gripsgard Date: Wed, 26 Dec 2018 00:39:55 +0100 Subject: [PATCH] Don't create a threaded delay This fixes #1 and fixes ubports/ubuntu-touch#860 --- ofonocallchannel.cpp | 7 +++---- ofonoconferencecallchannel.cpp | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ofonocallchannel.cpp b/ofonocallchannel.cpp index a04905c..e478d77 100644 --- a/ofonocallchannel.cpp +++ b/ofonocallchannel.cpp @@ -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); diff --git a/ofonoconferencecallchannel.cpp b/ofonoconferencecallchannel.cpp index 5997e3a..6a5e276 100644 --- a/ofonoconferencecallchannel.cpp +++ b/ofonoconferencecallchannel.cpp @@ -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(); } }