summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <david@freetype.org>2001-12-21 15:20:48 +0000
committerDavid Turner <david@freetype.org>2001-12-21 15:20:48 +0000
commit5fd895c9f40bf0c7b6417b34425630ea18beaa3f (patch)
tree5dc79c45a0d56816845c904a1da8fe0d16f8e0f9
parentb3bf8144df2d6222508f81ad9ac1a0e2147b3ee8 (diff)
downloadfreetype2-5fd895c9f40bf0c7b6417b34425630ea18beaa3f.tar.gz
* src/cid/cidobjs.c (CID_Face_Done): fixed a memory leak, the subrs
routines were never released when CID faces were destroyed
-rw-r--r--ChangeLog3
-rw-r--r--include/freetype/cache/ftcimage.h24
2 files changed, 16 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 63d1ca3f1..191ab7b28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@
2001-12-20 Werner Lemberg <wl@gnu.org>
+ * 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.
diff --git a/include/freetype/cache/ftcimage.h b/include/freetype/cache/ftcimage.h
index a8a4508a5..bc75466c6 100644
--- a/include/freetype/cache/ftcimage.h
+++ b/include/freetype/cache/ftcimage.h
@@ -155,9 +155,7 @@ FT_BEGIN_HEADER
/* 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 @@ FT_BEGIN_HEADER
/* 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 @@ FT_BEGIN_HEADER
/* 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,