# HG changeset patch # User Gareth Stockwell # Date 1287745161 -3600 # Node ID 7df094ed4a3f358dd4f42c26f12a647bfd449635 # Parent 69cf6858ae999696d375440c7a825d756719e8be Added a timer which kills eglbringuptest.exe after a short delay This is to allow the app to be used on a real device. Because it is a console app, there is no way to kill the application once it is running. diff -r 69cf6858ae99 -r 7df094ed4a3f egl/sfegltest/src/main.cpp --- a/egl/sfegltest/src/main.cpp Fri Oct 22 11:45:08 2010 +0100 +++ b/egl/sfegltest/src/main.cpp Fri Oct 22 11:59:21 2010 +0100 @@ -20,6 +20,9 @@ #define KDefaultScreenNo 0 +// Amount of time for which to run the app +static const TInt KAppRunDuration = 5000000; + class CWsRedrawHandler; class CWsCanvas: public CBase @@ -75,11 +78,15 @@ ~CWsApp(); void Start(); void Stop(); + +private: + static TInt TimerCallBack(TAny* aApp); private: CWsApp(); void ConstructL(); + CPeriodic* iTimer; CWsCanvas* iAppView; CEGLRendering* iDemo; TBool iCallWindow; @@ -251,6 +258,11 @@ void CWsApp::ConstructL() { RDebug::Printf("CWsApp::ConstructL()"); + + // Set a timer to stop the application after a short time + iTimer = CPeriodic::NewL(CActive::EPriorityIdle); + iTimer->Start(KAppRunDuration, KAppRunDuration, TCallBack(TimerCallBack,this)); + iPos = iQhd? iQhdPos : iQvgaPos; iScrId = KDefaultScreenNo; @@ -284,6 +296,12 @@ iCallWindow = EFalse; } +TInt CWsApp::TimerCallBack(TAny* aApp) + { + reinterpret_cast(aApp)->Stop(); + return KErrNone; + } + void CWsApp::Start() { RDebug::Printf("CWsApp::Start"); @@ -299,6 +317,7 @@ { delete iDemo; delete iAppView; + delete iTimer; } /**