shithub: freetype+ttf2subf

Download patch

ref: 79ea4cd40c88579369fea37751618e32e2ee5ab4
parent: f05003dace3ca35494fb8fcb42fdc1eea3d16b44
author: David Turner <[email protected]>
date: Fri Dec 21 10:20:48 EST 2001

* src/cid/cidobjs.c (CID_Face_Done): fixed a memory leak, the subrs
        routines were never released when CID faces were destroyed

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@
 
 2001-12-20  Werner Lemberg  <[email protected]>
 
+        * src/cid/cidobjs.c (CID_Face_Done): fixed a memory leak, the subrs
+        routines were never released when CID faces were destroyed
+
 	* src/cache/ftccache.c (ftc_node_destroy, ftc_cache_lookup): Fix
 	tracing strings.
 	* src/cache/ftccmap.c (ftc_cmap_family_init): Ditto.
--- a/include/freetype/cache/ftcimage.h
+++ b/include/freetype/cache/ftcimage.h
@@ -155,9 +155,7 @@
   /*    FTC_ImageCache_Lookup                                              */
   /*                                                                       */
   /* <Description>                                                         */
-  /*    Retrieves a given glyph image from a glyph image cache and         */
-  /*    `acquires' it.  This prevents the glyph image from being flushed   */
-  /*    out of the cache, until @FTC_Image_Cache_Release is called.        */
+  /*    Retrieves a given glyph image from a glyph image cache.            */
   /*                                                                       */
   /* <Input>                                                               */
   /*    cache  :: A handle to the source glyph image cache.                */
@@ -170,10 +168,8 @@
   /*    aglyph :: The corresponding @FT_Glyph object.  0 in case of        */
   /*              failure.                                                 */
   /*                                                                       */
-  /*    anode  :: An opaque cache node pointer that will be used to        */
-  /*              release the glyph once it becomes unuseful.  Can be      */
-  /*              NULL, in which case this function will have the same     */
-  /*              effect as @FTC_Image_Cache_Release.   XXX                */
+  /*    anode  :: used to return the address of of the corresponding       */
+  /*              cache node after incrementing its reference count        */
   /*                                                                       */
   /* <Return>                                                              */
   /*    FreeType error code.  0 means success.                             */
@@ -183,10 +179,16 @@
   /*    Never try to transform or discard it manually!  You can however    */
   /*    create a copy with @FT_Glyph_Copy and modify the new one.          */
   /*                                                                       */
-  /*    Because the glyph image cache limits the total amount of memory    */
-  /*    taken by the glyphs it holds, the returned glyph might disappear   */
-  /*    on a later invocation of this function!  It is a cache after       */
-  /*    all...                                                             */
+  /*    If "anode" is _not_ NULL, it receives the address of the cache     */
+  /*    node containing the glyph image, after increasing its reference    */
+  /*    count. This ensures that the node (as well as the FT_Glyph) will   */
+  /*    always be kept in the cache until you call @FTC_Node_Unref to      */
+  /*    "release" it.                                                      */
+  /*                                                                       */
+  /*    If "anode" is NULL, the cache node is left unchanged, which means  */
+  /*    that the FT_Glyph could be flushed out of the cache on the next    */
+  /*    call to one of the caching sub-system APIs. Just don't assume      */
+  /*    that it's persistent..                                             */
   /*                                                                       */
   FT_EXPORT( FT_Error )
   FTC_ImageCache_Lookup( FTC_ImageCache  cache,