diff -r 63c982fb92f2 -r b73252188534 harvester/common/inc/harvestdata.inl --- a/harvester/common/inc/harvestdata.inl Thu Jul 15 19:07:24 2010 +0300 +++ b/harvester/common/inc/harvestdata.inl Thu Aug 19 10:20:41 2010 +0300 @@ -80,9 +80,55 @@ // void CObjectDataArray::Append( CMdEObject* aMdeObject, CLocationData* aLocationData, CMdEQuery* aQuery ) { - iMdeObjectArray.Append( aMdeObject ); - iLocationArray.Append( aLocationData ); - iQueryArray.Append( aQuery ); + TInt mdeObjectIndex(KErrNone); + TInt locationDataIndex(KErrNone); + + mdeObjectIndex = iMdeObjectArray.Append( aMdeObject ); + + if( mdeObjectIndex != KErrNone ) + { + delete aMdeObject; + aMdeObject = NULL; + + delete aLocationData; + aLocationData = NULL; + + delete aQuery; + aQuery = NULL; + } + else + { + locationDataIndex = iLocationArray.Append( aLocationData ); + + if( locationDataIndex != KErrNone ) + { + iMdeObjectArray.Remove( mdeObjectIndex ); + delete aMdeObject; + aMdeObject = NULL; + + delete aLocationData; + aLocationData = NULL; + + delete aQuery; + aQuery = NULL; + } + else + { + if( iQueryArray.Append( aQuery ) != KErrNone ) + { + iMdeObjectArray.Remove( mdeObjectIndex ); + delete aMdeObject; + aMdeObject = NULL; + + iLocationArray.Remove( locationDataIndex ); + delete aLocationData; + aLocationData = NULL; + + delete aQuery; + aQuery = NULL; + } + } + } } // --------------------------------------------------------------------------- @@ -96,8 +142,14 @@ return; } delete iMdeObjectArray[aIndex]; + iMdeObjectArray[aIndex] = NULL; + delete iLocationArray[aIndex]; + iLocationArray[aIndex] = NULL; + delete iQueryArray[aIndex]; + iQueryArray[aIndex] = NULL; + iMdeObjectArray.Remove( aIndex ); iLocationArray.Remove( aIndex ); iQueryArray.Remove( aIndex );