ref: a87b08a7afb5f263b24a87271060762f00f21536
parent: e9a47198e6000debcd39fa1803b59215d3bc95af
author: Wu, Chia-I (吳佳一) <[email protected]>
date: Tue Feb 28 04:53:23 EST 2006
* src/base/ftobjs.c (FT_Done_Library): Modules are removed in the reversed order so that type42 module is removed before truetype module. This avoids double free in some occasions.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-28 Chia-I Wu <[email protected]>
+
+ * src/base/ftobjs.c (FT_Done_Library): Modules are removed in the
+ reversed order so that type42 module is removed before truetype
+ module. This avoids double free in some occasions.
+
2006-02-28 David Turner <[email protected]>
* tagging VER-2-2-0-RC4
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -3721,8 +3721,12 @@
/* Close all modules in the library */
#if 1
+ /* XXX Modules are removed in the reversed order so that */
+ /* type42 module is removed before truetype module. This */
+ /* avoids double free in some occasions. It is a hack. */
while ( library->num_modules > 0 )
- FT_Remove_Module( library, library->modules[0] );
+ FT_Remove_Module( library,
+ library->modules[library->num_modules - 1] );
#else
{
FT_UInt n;