metadataengine/client/src/mdequery.cpp
branchRCL_3
changeset 15 3cebc1a84278
parent 14 646a02f170b9
child 19 82c0024438c8
equal deleted inserted replaced
14:646a02f170b9 15:3cebc1a84278
    45 	Cancel();
    45 	Cancel();
    46   
    46   
    47     // This will destroy the entire conditions tree.
    47     // This will destroy the entire conditions tree.
    48    	delete iConditions;
    48    	delete iConditions;
    49 
    49 
    50    	const TInt count = iResults.Count();
       
    51    	
       
    52     // Destroy all result items this query instance owns.
    50     // Destroy all result items this query instance owns.
    53     for(TInt i = 0; i < count; ++i)
    51    	for( TInt i = iResults.Count() - 1; i >=0; i-- )
    54         {
    52         {
    55         if(iResults[i].iOwned)
    53         if(iResults[i].iOwned)
    56             {
    54             {
    57             delete iResults[i].iItem;
    55             delete iResults[i].iItem;
    58             }
    56             }
   147     if(iState == EStateSearching)
   145     if(iState == EStateSearching)
   148         {
   146         {
   149         User::Leave(KErrNotReady);
   147         User::Leave(KErrNotReady);
   150         }
   148         }
   151     
   149     
   152     const TInt count = iResults.Count();
       
   153     
       
   154 	// clear old results
   150 	// clear old results
   155 	// Destroy all result items this query instance owns.
   151 	// Destroy all result items this query instance owns.
   156     for(TInt i = 0; i < count; ++i)
   152     for( TInt i = iResults.Count() - 1; i >=0; i-- )
   157         {
   153         {
   158         if(iResults[i].iOwned)
   154         if(iResults[i].iOwned)
   159             {
   155             {
   160             delete iResults[i].iItem;
   156             delete iResults[i].iItem;
   161             }
   157             }