From 7e157b1e021f3ad16e588d4ba81f52c9813fceb6 Mon Sep 17 00:00:00 2001 From: Juha Kukkonen Date: Tue, 5 Jun 2012 15:07:09 +0300 Subject: Exlude user input events in nested event loops System Info and Service Framework use event loops for making asynchronous platform calls to work like synchronous calls. Nested event loops can cause unforeseen issues for applications if user actions are handled while executing inner event loop. Application may e.g. destroy objects too early that can lead to crash. Changed event loops to use ExcludeUserInputEvents flag. Task-number: ou1cimx1#1002406 Reviewed-by: Aapo Haapanen --- src/serviceframework/ipc/objectendpoint.cpp | 2 +- src/systeminfo/symbian/batterystatus_s60.cpp | 2 +- src/systeminfo/symbian/telephonyinfo_s60.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/serviceframework/ipc/objectendpoint.cpp b/src/serviceframework/ipc/objectendpoint.cpp index 199a3b0db9..0d54b7730a 100644 --- a/src/serviceframework/ipc/objectendpoint.cpp +++ b/src/serviceframework/ipc/objectendpoint.cpp @@ -651,7 +651,7 @@ void ObjectEndPoint::waitForResponse(const QUuid& requestId) QTimer::singleShot(30000, loop, SLOT(quit())); connect(this, SIGNAL(pendingRequestFinished()), loop, SLOT(quit())); - loop->exec(); + loop->exec(QEventLoop::ExcludeUserInputEvents); delete loop; } diff --git a/src/systeminfo/symbian/batterystatus_s60.cpp b/src/systeminfo/symbian/batterystatus_s60.cpp index 7bd241392c..70528eed07 100644 --- a/src/systeminfo/symbian/batterystatus_s60.cpp +++ b/src/systeminfo/symbian/batterystatus_s60.cpp @@ -331,7 +331,7 @@ TInt CBatteryHWRM::GetAverageCurrent() TRACES ( qDebug() << "started event loop..."); } - iEventLoop->exec(); + iEventLoop->exec(QEventLoop::ExcludeUserInputEvents); StopCurrentFlowMeasurement(); #endif return iAverageCurrent; diff --git a/src/systeminfo/symbian/telephonyinfo_s60.cpp b/src/systeminfo/symbian/telephonyinfo_s60.cpp index d381f04434..6da2515aad 100644 --- a/src/systeminfo/symbian/telephonyinfo_s60.cpp +++ b/src/systeminfo/symbian/telephonyinfo_s60.cpp @@ -86,7 +86,7 @@ void CTelephonyInfo::makeRequest() iEventLoop = new QEventLoop(); TRACES ( qDebug() << "started event loop..."); } - iEventLoop->exec(); //start the loop + iEventLoop->exec(QEventLoop::ExcludeUserInputEvents); //start the loop } CPhoneInfo::CPhoneInfo(CTelephony &telephony) : CTelephonyInfo(telephony), -- cgit v1.2.3