harvester/blacklistserver/src/blacklistserver.cpp
changeset 45 a93990e5815e
parent 36 aa5a574040a4
child 60 79f826a55db2
child 63 e538444823de
equal deleted inserted replaced
36:aa5a574040a4 45:a93990e5815e
   215     iBufferedAddedItems.Close();  	
   215     iBufferedAddedItems.Close();  	
   216    	
   216    	
   217    	iBlacklistServerChunk.Close();
   217    	iBlacklistServerChunk.Close();
   218  
   218  
   219     delete iSqLiteConnection;
   219     delete iSqLiteConnection;
       
   220     iSqLiteConnection = NULL;
   220 
   221 
   221     WRITELOG( "CBlacklistServer::~CBlacklistServer - end" );
   222     WRITELOG( "CBlacklistServer::~CBlacklistServer - end" );
   222     OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER, "CBlacklistServer::~CBlacklistServer -end " );
   223     OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_CBLACKLISTSERVER, "CBlacklistServer::~CBlacklistServer -end " );
   223     }
   224     }
   224 
   225 
   289     TInt result = KErrNoMemory;
   290     TInt result = KErrNoMemory;
   290     if (cleanup)
   291     if (cleanup)
   291         {
   292         {
   292         TRAP(result, CBlacklistServer::ExeMainL());
   293         TRAP(result, CBlacklistServer::ExeMainL());
   293         delete cleanup;
   294         delete cleanup;
       
   295         cleanup = NULL;
   294         }
   296         }
   295     __UHEAP_MARKEND;
   297     __UHEAP_MARKEND;
   296     WRITELOG( "CBlacklistServer::E32Main - end" );
   298     WRITELOG( "CBlacklistServer::E32Main - end" );
   297     OstTrace0( TRACE_NORMAL, DUP1__E32MAIN, "CBlacklistServer::E32Main -end" );
   299     OstTrace0( TRACE_NORMAL, DUP1__E32MAIN, "CBlacklistServer::E32Main -end" );
   298     
   300     
   493     CBlacklistItem* item = CBlacklistItem::NewL( aModified, aUri, aMediaId );
   495     CBlacklistItem* item = CBlacklistItem::NewL( aModified, aUri, aMediaId );
   494     const TInt err = iBlacklistMemoryTable.Append( item ); // ownership is transferred
   496     const TInt err = iBlacklistMemoryTable.Append( item ); // ownership is transferred
   495     if ( err != KErrNone )
   497     if ( err != KErrNone )
   496         {
   498         {
   497         delete item;
   499         delete item;
       
   500         item = NULL;
   498         }
   501         }
   499 
   502 
   500     WRITELOG( "CBlacklistServer::AddToMemoryTableL - end" );
   503     WRITELOG( "CBlacklistServer::AddToMemoryTableL - end" );
   501     OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL, "CBlacklistServer::AddToMemoryTableL - end" );
   504     OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_ADDTOMEMORYTABLEL, "CBlacklistServer::AddToMemoryTableL - end" );
   502     
   505     
   516     const TInt index = GetMemoryTableIndex( aUri, aMediaId );
   519     const TInt index = GetMemoryTableIndex( aUri, aMediaId );
   517     if ( index >= 0 )
   520     if ( index >= 0 )
   518         {
   521         {
   519         CBlacklistItem * item = iBlacklistMemoryTable[index];
   522         CBlacklistItem * item = iBlacklistMemoryTable[index];
   520         delete item;
   523         delete item;
       
   524         item = NULL;
   521         iBlacklistMemoryTable.Remove( index );
   525         iBlacklistMemoryTable.Remove( index );
   522         }
   526         }
   523 
   527 
   524     WRITELOG( "CBlacklistServer::RemoveFromMemoryTable - end" );
   528     WRITELOG( "CBlacklistServer::RemoveFromMemoryTable - end" );
   525     OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE, "CBlacklistServer::RemoveFromMemoryTable - end" );
   529     OstTrace0( TRACE_NORMAL, DUP1_CBLACKLISTSERVER_REMOVEFROMMEMORYTABLE, "CBlacklistServer::RemoveFromMemoryTable - end" );
   721         HBufC* lcBuf = aUri.AllocLC();
   725         HBufC* lcBuf = aUri.AllocLC();
   722     
   726     
   723         variables->AppendL( TColumn( lcBuf ) );     
   727         variables->AppendL( TColumn( lcBuf ) );     
   724         variables->AppendL( TColumn( aMediaId ) );    
   728         variables->AppendL( TColumn( aMediaId ) );    
   725  
   729  
   726         iBufferedRemoveItems.Append( variables ); // transfer ownership
   730         iBufferedRemoveItems.AppendL( variables ); // transfer ownership
   727         iDBUpdateNeeded = ETrue;
   731         iDBUpdateNeeded = ETrue;
   728         CleanupStack::Pop( lcBuf );
   732         CleanupStack::Pop( lcBuf );
   729         CleanupStack::Pop( 2, variables );
   733         CleanupStack::Pop( 2, variables );
   730         }
   734         }
   731     else
   735     else
   766 
   770 
   767         rowData->AppendL( TColumn( aLastModifiedTime ) );
   771         rowData->AppendL( TColumn( aLastModifiedTime ) );
   768         rowData->AppendL( TColumn( lcBuf ) );     
   772         rowData->AppendL( TColumn( lcBuf ) );     
   769         rowData->AppendL( TColumn( aMediaId ) );    
   773         rowData->AppendL( TColumn( aMediaId ) );    
   770 
   774 
   771         iBufferedAddedItems.Append( rowData ); // transfer ownership
   775         iBufferedAddedItems.AppendL( rowData ); // transfer ownership
   772         iDBUpdateNeeded = ETrue;
   776         iDBUpdateNeeded = ETrue;
   773         CleanupStack::Pop( lcBuf );
   777         CleanupStack::Pop( lcBuf );
   774         CleanupStack::Pop( 2, rowData );
   778         CleanupStack::Pop( 2, rowData );
   775         }
   779         }
   776     else
   780     else