First of all, Thanks Werner, the problem is solved now. I did make a mistake in calling FTC_ImageCache_LookupScaler(..., anode); passing non-NULL anode and never calls FTC_Node_Unref(anode, manager), making the glyphs in the cache to be persistent and will never be deleted. This is specified in the API reference. Sorry, I missed that part.
Another problem of mine still remains. It is related with FTC_Manager_RemoveFaceID(). When I called this function to delete a specific font face by passing the corresponding FTC_FaceID object, the cache manager deleted ALL the face nodes instead of the specific node corresponding to the intended font face.
I checked the implementation of the function FTC_Manager_RemoveFaceID(face_id, ...), on the freetype source code ftcmanag.c. Function FTC_MruList_RemoveSelection() calls and pass NULL FTC_MruNode_CompareFunc function pointer to FTC_MruList_RemoveSelection().
Since the CompareFunction is NULL, inside the function FTC_MruList_RemoveSelection() all the faces stored in the cache is deleted, instead of just a specific face corresponds to face_id. Any of you have some knowledge on this?
I'm currently using Freetype 2.3.7. I am looking forward to your advice and help. Many thanks in advance
best regards
Maggy Anastasia
On Fri, Aug 28, 2009 at 3:06 PM, Werner LEMBERG
<address@hidden> wrote:
> I would like to consult with you regarding cache subsystem. [...]
I'm not familiar with the cache subsystem, and David is usually very
busy and doesn't answer emails, sorry.
My advice: Check the source code of the `ftview' application which
uses the cache subsystem, and activate FreeType's memory debugger (see
docs/DEBUG) if necessary. In case you experience the same problem of
an ever-growing cache or memory leaks, it is a bug in FreeType.
Werner