videoscheduler/SchedulerServer/src/CCseSchedulerServer.cpp
branchRCL_3
changeset 44 e53284de66c2
parent 0 822a42b6c3f1
equal deleted inserted replaced
38:64f6657d3cc1 44:e53284de66c2
   166     {
   166     {
   167     CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerServer::ThreadFunction");
   167     CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerServer::ThreadFunction");
   168 	CTrapCleanup* cleanupStack = CTrapCleanup::New();    
   168 	CTrapCleanup* cleanupStack = CTrapCleanup::New();    
   169     if ( !cleanupStack )
   169     if ( !cleanupStack )
   170         {
   170         {
   171         PanicServer( ECseCreateTrapCleanup );
   171         CSELOGSTRING_HIGH_LEVEL("CCseSchedulerServer::ThreadFunction - Could not create cleanupstack: %d");
       
   172         return KErrNone;
   172         }
   173         }
   173 
   174 
   174     TRAPD( err, ThreadFunctionL( ) );
   175     TRAPD( err, ThreadFunctionL( ) );
   175     if ( err )
   176     if ( err )
   176         {
   177         {
   177         PanicServer( ECseSrvCreateServer );
   178         CSELOGSTRING2_HIGH_LEVEL("CCseSchedulerServer::ThreadFunction - Main thread leaved: %d", err );
   178         }
   179         }
   179 
   180 
   180     delete cleanupStack;    
   181     delete cleanupStack;    
   181     
   182     
   182     CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerServer::ThreadFunction");
   183     CSELOGSTRING_HIGH_LEVEL("<<<CCseSchedulerServer::ThreadFunction");
   298 // Stops active scheduler and deletes object container and other objects.
   299 // Stops active scheduler and deletes object container and other objects.
   299 // -----------------------------------------------------------------------------
   300 // -----------------------------------------------------------------------------
   300 void CCseSchedulerServer::DeleteSchedulerEngine()
   301 void CCseSchedulerServer::DeleteSchedulerEngine()
   301     {
   302     {
   302 	CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerServer::DeleteSchedulerEngine");
   303 	CSELOGSTRING_HIGH_LEVEL(">>>CCseSchedulerServer::DeleteSchedulerEngine");
   303     
   304 		
   304     if ( iContainerIx )
   305     if ( iContainerIx )
   305         {
   306         {
   306         iSchedulerEngine->Close();
   307         if( iObjectCon->Count() > 0 )
       
   308             {
       
   309             iSchedulerEngine->Close();
       
   310             }
       
   311     
   307         iContainerIx->Remove( iObjectCon );
   312         iContainerIx->Remove( iObjectCon );
   308         delete iContainerIx; 
   313         delete iContainerIx; 
   309 		iContainerIx = NULL;
   314 		iContainerIx = NULL;
   310 		iSchedulerEngine = NULL;
   315 		iSchedulerEngine = NULL;
   311         }
   316         }
   312 
   317     
   313     if( iStarterBreaker->IsActive() )
   318     if( iStarterBreaker && iStarterBreaker->IsActive() )
   314         {
   319         {
   315         iStarterBreaker->Cancel();
   320         iStarterBreaker->Cancel();
   316         }
   321         }
   317     delete iStarterBreaker;    
   322     delete iStarterBreaker;    
   318     iStarterBreaker = NULL;
   323     iStarterBreaker = NULL;