fbs/fontandbitmapserver/sfbs/SESSION.CPP
changeset 194 18f84489a694
parent 168 2bd88482bfe5
equal deleted inserted replaced
183:6a1564a2f3e6 194:18f84489a694
   177 	{
   177 	{
   178 	RFbsSession* thisptr=(RFbsSession*)Dll::Tls();
   178 	RFbsSession* thisptr=(RFbsSession*)Dll::Tls();
   179     FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_DISCONNECT_ENTRY, "> this=0x%08x;", (TUint)thisptr);)
   179     FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_DISCONNECT_ENTRY, "> this=0x%08x;", (TUint)thisptr);)
   180 	if(thisptr)
   180 	if(thisptr)
   181 	    {
   181 	    {
   182         TInt tempServerSessionHandle = thisptr->ServerSessionHandle();
   182         FBS_OST(TInt tempServerSessionHandle = (thisptr->iHelper) ? thisptr->iHelper->iServerSessionHandle : 0;)
   183         if(thisptr->iConnections>0)
   183         if(thisptr->iConnections>0)
   184             {
   184             {
   185             thisptr->iCallBack.iPtr=NULL;
   185             thisptr->iCallBack.iPtr=NULL;
   186             thisptr->iCallBack.CallBack();
   186             thisptr->iCallBack.CallBack();
   187             // Destructor of CFbsSessionHelper may call SendCommand to cancel an
   187             // Destructor of CFbsSessionHelper may call SendCommand to cancel an
   191                 {
   191                 {
   192                 delete thisptr->iHelper;
   192                 delete thisptr->iHelper;
   193                 }
   193                 }
   194             thisptr->iConnections--;
   194             thisptr->iConnections--;
   195             }
   195             }
       
   196         FBS_OST(TInt tempConnectionCount = thisptr->iConnections;)
   196         if(thisptr->iConnections==0)
   197         if(thisptr->iConnections==0)
   197             {
   198             {
   198             thisptr->iSharedChunk.Close();
   199             thisptr->iSharedChunk.Close();
   199             thisptr->iLargeBitmapChunk.Close();
   200             thisptr->iLargeBitmapChunk.Close();
   200             // Call close on the iFileServer regardless of whether this session owns it: 
   201             // Call close on the iFileServer regardless of whether this session owns it: 
   206             delete thisptr->iDecompressionBuffer;
   207             delete thisptr->iDecompressionBuffer;
   207             thisptr->Close();
   208             thisptr->Close();
   208             delete thisptr;
   209             delete thisptr;
   209             Dll::FreeTls();	
   210             Dll::FreeTls();	
   210             }
   211             }
   211         FBS_OST(OstTraceExt3(GRAPHICS_CONTROL_SEMANTICS, RFBSSESSION_DISCONNECT_INFO, "# Disconnected from session; this=0x%08x; iConnections=%d; iSSH=0x%08x", (TInt)thisptr, thisptr->iConnections, tempServerSessionHandle);)
   212         FBS_OST(OstTraceExt3(GRAPHICS_CONTROL_SEMANTICS, RFBSSESSION_DISCONNECT_INFO, "# Disconnected from session; this=0x%08x; iConnections=%d; iSSH=0x%08x", (TInt)thisptr, tempConnectionCount, tempServerSessionHandle);)
   212 	    }
   213 	    }
   213 	FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_DISCONNECT_EXIT2, "< this=0x%08x;", (TUint)thisptr);)
   214 	FBS_OST(OstTrace1(GRAPHICS_CONTROL_FUNCTIONS, RFBSSESSION_DISCONNECT_EXIT2, "< this=0x%08x;", (TUint)thisptr);)
   214 	}
   215 	}
   215 
   216 
   216 /**  Gets the current Font and Bitmap server session.
   217 /**  Gets the current Font and Bitmap server session.