fbs/fontandbitmapserver/sfbs/FBSCLI.CPP
branchRCL_3
changeset 177 183e23d95fab
parent 164 25ffed67c7ef
child 209 5c40347c6f16
equal deleted inserted replaced
164:25ffed67c7ef 177:183e23d95fab
    87 	return c;
    87 	return c;
    88 	}
    88 	}
    89 
    89 
    90 CFbClient::~CFbClient()
    90 CFbClient::~CFbClient()
    91 	{
    91 	{
       
    92     FBS_OST( OstTraceExt2( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_DESTRUCTOR_INFO, "# Server session destroyed; rc=%d; iSSH=0x%08x;", iResourceCount, iSessionHandle);)
    92 	/*
    93 	/*
    93 	Don't call any CFontStore functions if CFbClient::NewL has left, or if FBSERV has already deleted the
    94 	Don't call any CFontStore functions if CFbClient::NewL has left, or if FBSERV has already deleted the
    94 	font store, which happens in test programs like TFBS when FBSERV is closed before the client(s).
    95 	font store, which happens in test programs like TFBS when FBSERV is closed before the client(s).
    95 	*/
    96 	*/
    96 	CFontStore* font_store = NULL;
    97 	CFontStore* font_store = NULL;
    99 		{
   100 		{
   100 		font_store = fbTop->FontStore();
   101 		font_store = fbTop->FontStore();
   101 		}
   102 		}
   102 	
   103 	
   103 	if (font_store)
   104 	if (font_store)
       
   105 	    {
   104 		font_store->DeleteSessionCache(iSessionHandle);
   106 		font_store->DeleteSessionCache(iSessionHandle);
       
   107 	    }
   105 	
   108 	
   106 	// If the font store doesn't exist, neither will the shared heap owned by FBSERV.
   109 	// If the font store doesn't exist, neither will the shared heap owned by FBSERV.
   107 	if (font_store)
   110 	if (font_store)
       
   111 	    {
   108 		iHeap->Free(iOpenFontGlyphData);
   112 		iHeap->Free(iOpenFontGlyphData);
   109 	
   113 	    }
   110 	// delete fonts hold by the client
   114 
       
   115     // output each bitmap that is about to be destroyed...
       
   116 	FBS_OST
       
   117         ({
       
   118         for (TInt ii = iIx->Count() - 1; ii >= 0; --ii)
       
   119             {
       
   120             CObject* object = (*iIx)[ii];
       
   121             TInt localHandle = iIx->At(object);
       
   122             if ((localHandle != KErrNotFound) && (iIx->At(localHandle, fbTop->BitmapConUniqueID()) != NULL))
       
   123                 {
       
   124                 OstTraceExt3( GRAPHICS_RESOURCE_MANAGEMENT_SEMANTICS, CFBCLIENT_DESTRUCTOR_INFO2, "# Server resource destroyed; iSSH=0x%08x; rc=%d; iH=0x%08x;", iSessionHandle, iResourceCount, localHandle);
       
   125                 }
       
   126             }
       
   127 	    })
       
   128 	// delete fonts and bitmaps held by the client
   111 	delete iIx;
   129 	delete iIx;
   112 	
   130 	
   113 	// delete font files hold by the client
   131 	// delete font files held by the client
   114     if (iFontFileIndex)
   132     if (iFontFileIndex)
   115         {
   133         {
   116         TInt count = iFontFileIndex->Count();
   134         TInt count = iFontFileIndex->Count();
   117         for (TInt index = 0;index < count; index++)
   135         for (TInt index = 0;index < count; index++)
   118             {
   136             {