serviceproviders/sapi_logging/src/loggingcallback.cpp
branchRCL_3
changeset 52 68159986cd41
parent 37 5d0ec8b709be
child 56 c210248fa89d
--- a/serviceproviders/sapi_logging/src/loggingcallback.cpp	Mon Mar 15 12:43:25 2010 +0200
+++ b/serviceproviders/sapi_logging/src/loggingcallback.cpp	Wed Mar 31 23:02:09 2010 +0300
@@ -89,12 +89,21 @@
         {
         case EReadEvents :
             {
+            if( aStatus == KErrNone )
+            	{	
             CLiwLogIter *iter = CLiwLogIter :: NewL( aIter ) ;
             CleanupClosePushL( *iter );
             OutParm->AppendL( TLiwGenericParam ( KResponse , TLiwVariant( iter ) )  ) ;
             CleanupStack :: Pop( iter ) ;
             iter->DecRef();
             iCallBack->HandleNotifyL( aTransId, KLiwEventCompleted, *OutParm, *InParm ) ;
+          		}
+          	else
+          		{
+          		iCallBack->HandleNotifyL( aTransId, KLiwEventError, *OutParm, *InParm ) ;
+          		delete aIter;
+          		aIter = NULL; 
+          		}	
             CleanupStack::PopAndDestroy( InParm );
             CleanupStack::PopAndDestroy( OutParm );
             CleanupStack :: Pop( this ) ;
@@ -104,13 +113,22 @@
     
         case EGetEvent :
             {
+            if( aStatus == KErrNone )
+            	{		
             CLiwLogIter *iter = CLiwLogIter :: NewL( aIter ) ;
             CleanupClosePushL( *iter );
             OutParm->AppendL( TLiwGenericParam ( KResponse , TLiwVariant( iter ) )  ) ;
             CleanupStack :: Pop( iter ) ;
             iter->DecRef();
             iCallBack->HandleNotifyL( aTransId, KLiwEventCompleted, *OutParm, *InParm ) ;
-            CleanupStack::PopAndDestroy( InParm );
+          		}
+          	else
+          		{
+          		iCallBack->HandleNotifyL( aTransId, KLiwEventError, *OutParm, *InParm ) ;
+          		delete aIter;
+          		aIter = NULL; 
+          		}		
+          	CleanupStack::PopAndDestroy( InParm );
             CleanupStack::PopAndDestroy( OutParm );
             CleanupStack :: Pop( this ) ;
             delete this ;
@@ -119,12 +137,21 @@
     
         case EGetRecent :
             {
+            if( aStatus == KErrNone )
+            	{		
             CLiwLogIter *iter = CLiwLogIter :: NewL( aIter ) ;
             CleanupClosePushL( *iter );
             OutParm->AppendL( TLiwGenericParam ( KResponse , TLiwVariant( iter ) )  ) ;
             CleanupStack :: Pop( iter ) ;
             iter->DecRef();
             iCallBack->HandleNotifyL( aTransId, KLiwEventCompleted, *OutParm, *InParm ) ;
+          		}
+          	else
+          		{
+          		iCallBack->HandleNotifyL( aTransId, KLiwEventError, *OutParm, *InParm ) ;
+          		delete aIter;
+          		aIter = NULL; 
+          		}			
             CleanupStack::PopAndDestroy( InParm );
             CleanupStack::PopAndDestroy( OutParm );
             CleanupStack :: Pop( this ) ;