diff -r 2669f8761a99 -r fbd2e7cec7ef simpleengine/xmlutils/src/simpleelement.cpp --- a/simpleengine/xmlutils/src/simpleelement.cpp Tue Aug 31 15:35:50 2010 +0300 +++ b/simpleengine/xmlutils/src/simpleelement.cpp Wed Sep 01 12:23:14 2010 +0100 @@ -221,6 +221,7 @@ TInt CSimpleElement::SimpleElementsL( RPointerArray& aElementArray ) { + CleanupClosePushL( aElementArray ); // Reset the output array first. aElementArray.Reset(); iElements.ResetAndDestroy(); @@ -234,10 +235,12 @@ CSenElement* pElement = elems[i]; CSimpleElement* simple = CSimpleElement::NewL( pElement, EFalse ); CleanupStack::PushL( simple ); - User::LeaveIfError( aElementArray.Append( simple )); + iElements.AppendL( simple ); CleanupStack::Pop( simple ); - User::LeaveIfError( iElements.Append( simple ) ); + aElementArray.AppendL( simple ); } + CleanupStack::Pop( &aElementArray ); + return elemCount ? KErrNone : KErrNotFound; } @@ -292,6 +295,8 @@ // TInt CSimpleElement::SimpleAttributesL( RPointerArray& aArray ) { + CleanupClosePushL( aArray ); + // Reset the output array first. aArray.Reset(); iAttributes.ResetAndDestroy(); @@ -304,10 +309,12 @@ CSenBaseAttribute* pAttr = elems[i]; CSimpleAttribute* attr = CSimpleAttribute::NewL( pAttr ); CleanupStack::PushL( attr ); - User::LeaveIfError(iAttributes.Append( attr )); + iAttributes.AppendL( attr ); CleanupStack::Pop( attr ); - User::LeaveIfError(aArray.Append( attr )); + aArray.AppendL( attr ); } + CleanupStack::Pop( &aArray ); + return elemCount ? KErrNone : KErrNotFound; }