metadataengine/client/src/mdequery.cpp
branchRCL_3
changeset 19 b73252188534
parent 9 82c0024438c8
equal deleted inserted replaced
18:63c982fb92f2 19:b73252188534
    44     iDestroyed = ETrue;
    44     iDestroyed = ETrue;
    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    	iConditions = NULL;
       
    50    	
    50     // Destroy all result items this query instance owns.
    51     // Destroy all result items this query instance owns.
    51    	for( TInt i = iResults.Count() - 1; i >=0; i-- )
    52    	for( TInt i = iResults.Count() - 1; i >=0; i-- )
    52         {
    53         {
    53         if(iResults[i].iOwned)
    54         if(iResults[i].iOwned)
    54             {
    55             {
    55             delete iResults[i].iItem;
    56             delete iResults[i].iItem;
       
    57             iResults[i].iItem = NULL;
    56             }
    58             }
    57         }
    59         }
    58 
    60 
    59     // Destroy object result item this query instance owns  
    61     // Destroy object result item this query instance owns  
    60     if(iObjectResult.iItem)
    62     if(iObjectResult.iItem)
    75 
    77 
    76     iOrderRules.Close();
    78     iOrderRules.Close();
    77     iObservers.Close();
    79     iObservers.Close();
    78 
    80 
    79    	delete iDistinctResults;
    81    	delete iDistinctResults;
       
    82    	iDistinctResults = NULL;
    80 	}
    83 	}
    81 
    84 
    82 
    85 
    83 EXPORT_C TQueryType CMdEQuery::Type() const
    86 EXPORT_C TQueryType CMdEQuery::Type() const
    84     {
    87     {
   152     for( TInt i = iResults.Count() - 1; i >=0; i-- )
   155     for( TInt i = iResults.Count() - 1; i >=0; i-- )
   153         {
   156         {
   154         if(iResults[i].iOwned)
   157         if(iResults[i].iOwned)
   155             {
   158             {
   156             delete iResults[i].iItem;
   159             delete iResults[i].iItem;
       
   160             iResults[i].iItem = NULL;
   157             }
   161             }
   158         }
   162         }
   159 	iResults.Reset();
   163 	iResults.Reset();
   160 
   164 
   161     // Destroy object result item this query instance owns  
   165     // Destroy object result item this query instance owns