videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/src/VCXTestMessageWait.cpp
changeset 3 bdf78597b41c
parent 0 822a42b6c3f1
child 15 6c92a12abac0
--- a/videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/src/VCXTestMessageWait.cpp	Mon Jan 18 21:13:36 2010 +0200
+++ b/videoutils_plat/videoconnutility_api/tsrc/VCXTestCommon/src/VCXTestMessageWait.cpp	Tue Jan 26 12:55:56 2010 +0200
@@ -205,6 +205,8 @@
         }
     else
         {
+        iWaitStarted = EFalse;
+        
         // Nothing to wait for.
         iTimeoutTimer->CancelTimer();
         
@@ -245,10 +247,17 @@
 //
 EXPORT_C void CVCXTestMessageWait::ReceiveMessage( TInt32 aMsg, TInt aError )
 	{
+    if( !iWaitStarted )
+        {
+        VCXLOGLO1("CVCXTestMessageWait::ReceiveMessage: Wait not active.");
+        return;
+        }
+
     VCXLOGLO1(">>>CVCXTestMessageWait::ReceiveMessage");
 
     if( aError != KErrNone )
         {
+        iWaitStarted = EFalse;
         if( iActiveWaitBlocking->IsWaiting() )
             {
             iError = aError;
@@ -291,6 +300,7 @@
         
         if( iWaitedMessages.Count() <= 0 )
             {
+            iWaitStarted = EFalse;
             // Stop wait.
             if( iActiveWaitBlocking->IsWaiting() )
                 {
@@ -327,6 +337,7 @@
         else
         if( iWaitedMessages.Count() > 0 )
             {
+            iWaitStarted = EFalse;
             VCXLOGLO2("CVCXTestMessageWait:: Timeout. Messages left: %d", iWaitedMessages.Count());
             if( iActiveWaitBlocking->IsWaiting() )
                 {