calendarui/controller/src/calennotifier.cpp
branchRCL_3
changeset 12 38571fd2a704
parent 5 42814f902fe6
child 19 1984aceb8774
equal deleted inserted replaced
5:42814f902fe6 12:38571fd2a704
    69 //
    69 //
    70 CCalenNotifier::~CCalenNotifier()
    70 CCalenNotifier::~CCalenNotifier()
    71     {
    71     {
    72     TRACE_ENTRY_POINT;
    72     TRACE_ENTRY_POINT;
    73 
    73 
       
    74     // Reset the handler array.
       
    75     // Before we reset , close hashset for each handler
       
    76     for(TInt i = 0 ; i < iHandlers.Count() ; i++)
       
    77         {
       
    78         iHandlers[i].iHashSet.Close();
       
    79         }
       
    80     
       
    81     iHandlers.Reset();
       
    82     iBroadcastQueue.Reset();
       
    83 
       
    84     if( iAsyncCallback )
       
    85         {
       
    86         iAsyncCallback->Cancel();
       
    87         delete iAsyncCallback;
       
    88         iAsyncCallback = NULL;
       
    89         }
       
    90     
       
    91     if( iFilnameDeleted )
       
    92         {
       
    93         delete iFilnameDeleted;
       
    94         iFilnameDeleted = NULL;
       
    95         }
       
    96     
       
    97     // Stop ECom change notifications
       
    98     if( iEComWatcher )
       
    99         {
       
   100         delete iEComWatcher;
       
   101         iEComWatcher = NULL;
       
   102         }
       
   103 
    74     // Stop database change notifications.
   104     // Stop database change notifications.
    75     delete iDbChangeNotifier;
   105     if( iDbChangeNotifier )
    76 
   106         {
    77     // Stop ECom change notifications
   107         delete iDbChangeNotifier;
    78     delete iEComWatcher;
   108         iDbChangeNotifier = NULL;
    79 
   109         }
       
   110     
       
   111     // Stop settings change notifications
       
   112     if( iCenRepChangeNotifier )
       
   113         {
       
   114         delete iCenRepChangeNotifier;
       
   115         iCenRepChangeNotifier = NULL;
       
   116         }
       
   117     
       
   118     if( iRepository )
       
   119         {
       
   120         delete iRepository;
       
   121         iRepository = NULL;
       
   122         }
       
   123     
       
   124     // Stop environment change notifications
       
   125     if( iEnvChangeNotifier )
       
   126         {
       
   127         iEnvChangeNotifier->Cancel();
       
   128         delete iEnvChangeNotifier;
       
   129         }
       
   130     
       
   131     if( iSetting )
       
   132         {
       
   133         iSetting->Release();
       
   134         }
       
   135     
    80     // Release the global data
   136     // Release the global data
    81     if( iGlobalData )
   137     if( iGlobalData )
    82         {
   138         {
    83         // stop listening for calendar file change notifications
   139         // stop listening for calendar file change notifications
    84         iGlobalData->CalSessionL().StopFileChangeNotification();
   140         iGlobalData->CalSessionL().StopFileChangeNotification();
    85         iGlobalData->Release();
   141         iGlobalData->Release();
    86         }
   142         }
    87 
       
    88     if( iSetting )
       
    89         {
       
    90         iSetting->Release();
       
    91         }
       
    92 
       
    93     // Stop environment change notifications
       
    94     if( iEnvChangeNotifier )
       
    95         {
       
    96         iEnvChangeNotifier->Cancel();
       
    97         delete iEnvChangeNotifier;
       
    98         }
       
    99 
       
   100     // Stop settings change notifications
       
   101     delete iCenRepChangeNotifier;
       
   102     delete iRepository;
       
   103 
       
   104     // Reset the handler array.
       
   105     // Before we reset , close hashset for each handler
       
   106     for(TInt i = 0 ; i < iHandlers.Count() ; i++)
       
   107         {
       
   108         iHandlers[i].iHashSet.Close();
       
   109         }
       
   110     
       
   111     iHandlers.Reset();
       
   112     iBroadcastQueue.Reset();
       
   113 
       
   114 	
       
   115 	
       
   116 	iAsyncCallback->Cancel();
       
   117 	delete iAsyncCallback;
       
   118 	
       
   119 	delete iFilnameDeleted;
       
   120 	
       
   121 	TRACE_EXIT_POINT;
   143 	TRACE_EXIT_POINT;
   122 	}
   144 	}
   123 
   145 
   124 // ----------------------------------------------------------------------------
   146 // ----------------------------------------------------------------------------
   125 // CCalenNotifier::ConstructL
   147 // CCalenNotifier::ConstructL