mtpfws/mtpfw/daemon/server/src/cmtpserver.cpp
branchRCL_3
changeset 15 f85613f12947
parent 0 d0791faffa3f
equal deleted inserted replaced
13:81da3301b632 15:f85613f12947
    71 */
    71 */
    72 CMTPServer::~CMTPServer()
    72 CMTPServer::~CMTPServer()
    73     {
    73     {
    74     __FLOG(_L8("~CMTPServer - Entry"));
    74     __FLOG(_L8("~CMTPServer - Entry"));
    75     delete iShutdown;
    75     delete iShutdown;
       
    76     iShutdown = NULL;
    76     iFrameworkSingletons.ConnectionMgr().StopTransports();
    77     iFrameworkSingletons.ConnectionMgr().StopTransports();
    77     iFrameworkSingletons.DpController().UnloadDataProviders();
    78     iFrameworkSingletons.DpController().UnloadDataProviders();
    78     iFrameworkSingletons.Close();
    79     iFrameworkSingletons.Close();
    79     REComSession::FinalClose();
    80     REComSession::FinalClose();
    80     __FLOG(_L8("~CMTPServer - Exit"));
    81     __FLOG(_L8("~CMTPServer - Exit"));
   137     __FLOG(_L8("DropSession - Entry"));
   138     __FLOG(_L8("DropSession - Entry"));
   138          
   139          
   139     if (--iSessionCount==0 && iFrameworkSingletons.ConnectionMgr().TransportCount() == 0)
   140     if (--iSessionCount==0 && iFrameworkSingletons.ConnectionMgr().TransportCount() == 0)
   140         {
   141         {
   141         // No active MTP client API sessions remain, start the shutdown timer.
   142         // No active MTP client API sessions remain, start the shutdown timer.
   142         if (!iShutdown)
       
   143             {
       
   144             TRAPD(error, iShutdown = CMTPShutdown::NewL());
       
   145             __FLOG(_L8("CMTPShutdown Loaded- Entry"));
       
   146             UNUSED_VAR(error);    
       
   147             }
       
   148         if (iShutdown)
   143         if (iShutdown)
   149             {
   144             {
   150             __FLOG(_L8("Shutdown Started - Entry"));
   145             __FLOG(_L8("Shutdown Started - Entry"));
   151             iShutdown->Start();
   146             iShutdown->Start();
   152             }
   147             }
   191     {
   186     {
   192     __FLOG_OPEN(KMTPSubsystem, KComponent);
   187     __FLOG_OPEN(KMTPSubsystem, KComponent);
   193     __FLOG(_L8("ConstructL - Entry"));
   188     __FLOG(_L8("ConstructL - Entry"));
   194     StartL(KMTPServerName);
   189     StartL(KMTPServerName);
   195     iFrameworkSingletons.OpenL();
   190     iFrameworkSingletons.OpenL();
       
   191     if (!iShutdown)
       
   192         {
       
   193         TRAPD(error, iShutdown = CMTPShutdown::NewL());
       
   194         __FLOG(_L8("CMTPShutdown Loaded- Entry"));
       
   195         UNUSED_VAR(error);    
       
   196         }    
   196     __FLOG(_L8("ConstructL - Exit"));
   197     __FLOG(_L8("ConstructL - Exit"));
   197     }
   198     }
   198         
   199         
   199 /*
   200 /*
   200 RMessage::Panic() also completes the message. This is:
   201 RMessage::Panic() also completes the message. This is: