metadataengine/client/src/mdesessionimpl.cpp
branchRCL_3
changeset 6 646a02f170b9
parent 2 b73a2e62868f
child 7 3cebc1a84278
--- a/metadataengine/client/src/mdesessionimpl.cpp	Fri Feb 19 23:14:48 2010 +0200
+++ b/metadataengine/client/src/mdesessionimpl.cpp	Fri Mar 12 15:44:28 2010 +0200
@@ -68,7 +68,11 @@
 			RMdESessionAsyncRequest::EAddRequest, 
 			aBuffer, aResultBuffer, aRequestStatus );
 
-	iRequests.Append(request);
+	const TInt error = iRequests.Append(request);
+    if( error != KErrNone )
+        {
+        return;
+        }
 
 	if( !IsActive() )
 		{
@@ -86,7 +90,11 @@
 			RMdESessionAsyncRequest::EUpdateRequest,
 			aBuffer, aResultBuffer, aRequestStatus);
 
-	iRequests.Append(request);
+	const TInt error = iRequests.Append(request);
+    if( error != KErrNone )
+        {
+        return;
+        }
 
 	if( !IsActive() )
 		{
@@ -104,7 +112,11 @@
 			RMdESessionAsyncRequest::ERemoveRequest, 
 			aBuffer, aResultBuffer, aRequestStatus);
 
-	iRequests.Append(request);
+	const TInt error = iRequests.Append(request);
+	if( error != KErrNone )
+	    {
+	    return;
+	    }
 
 	if( !IsActive() )
 		{
@@ -224,8 +236,6 @@
 	{
     // No session errors should be sent during deconstruction to avoid possible double deletion
     iSessionObserver = NULL;
-    
-	Close();
 
 	delete iSchemaBuffer;
 
@@ -253,8 +263,6 @@
 
 void CMdESessionImpl::Close()
 	{
-	iSchemaObserverArray.Reset();
-	iSchemaObserverArray.Close();
 	}
 
 TInt CMdESessionImpl::NamespaceDefCount() const
@@ -1669,7 +1677,7 @@
 	{
 	RPointerArray<CMdEInstanceItem> items;
 	CleanupClosePushL( items );
-	items.Append( &aItem );
+	items.AppendL( &aItem );
 	User::LeaveIfError( AddItemsL( items ) );
 	CleanupStack::PopAndDestroy( &items );
 	return aItem.Id();
@@ -1898,7 +1906,7 @@
     {
 	RPointerArray<CMdEInstanceItem> items;
 	CleanupClosePushL( items );
-	items.Append( &aRelation );
+	items.AppendL( &aRelation );
 	User::LeaveIfError( UpdateItemsL( items ) );
 	CleanupStack::PopAndDestroy( &items );
 	return aRelation.Id();
@@ -2269,7 +2277,7 @@
     notifier->RegisterL( type, &aObserver, aCondition, *namespaceDef );
 
     CleanupStack::Pop( notifier );
-    iNotifiers.Append( notifier );
+    iNotifiers.AppendL( notifier );
     
     CleanupStack::PopAndDestroy( aCondition );
     }
@@ -2296,7 +2304,7 @@
     		&aObserver, NULL, namespaceDef );
 
     CleanupStack::Pop( notifier );
-    iNotifiers.Append( notifier );
+    iNotifiers.AppendL( notifier );
 	}
 
 void CMdESessionImpl::AddRelationObserverL( MMdERelationObserver& aObserver,
@@ -2352,7 +2360,7 @@
     notifier->RegisterL( type, &aObserver, aCondition, *namespaceDef );
 
     CleanupStack::Pop( notifier );
-    iNotifiers.Append( notifier );
+    iNotifiers.AppendL( notifier );
     
     CleanupStack::PopAndDestroy( aCondition );
     }
@@ -2409,7 +2417,7 @@
 	notifier->RegisterL( type, &aObserver, aCondition, *namespaceDef );
 	
 	CleanupStack::Pop( notifier );
-	iNotifiers.Append( notifier );
+	iNotifiers.AppendL( notifier );
 	
     CleanupStack::PopAndDestroy( aCondition );
 	}
@@ -2438,7 +2446,7 @@
     		&aObserver, NULL, namespaceDef );
 
     CleanupStack::Pop( notifier );
-    iNotifiers.Append( notifier );
+    iNotifiers.AppendL( notifier );
 	}
 
 void CMdESessionImpl::AddEventObserverL( MMdEEventObserver& aObserver,
@@ -2495,7 +2503,7 @@
     notifier->RegisterL( type, &aObserver, aCondition, *namespaceDef );
 
     CleanupStack::Pop( notifier );
-    iNotifiers.Append( notifier );
+    iNotifiers.AppendL( notifier );
     
     CleanupStack::PopAndDestroy( aCondition );
     }