Commit 2dc107949433f00905fab4206a5ec47c51ecb6d3

Suzuki, Toshiya (鈴木俊哉) 2009-01-09T05:07:15

* src/base/ftobjs.c (FT_Done_Library): Issue an error when FT_Done_Face() is failed and retried

diff --git a/ChangeLog b/ChangeLog
index 6eba886..5527797 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-09  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
+
+	* src/base/ftobjs.c (FT_Done_Library): Issue an error message when
+	FT_Done_Face() cannot free all faces. If the list of the opened
+	faces includes broken face which FT_Done_Face() cannot free,
+	FT_Done_Library() retries FT_Done_Face() and it can fall into
+	an endless loop. See the discussion:
+	http://lists.gnu.org/archive/html/freetype-devel/2008-09/msg00047.html
+	http://lists.gnu.org/archive/html/freetype-devel/2008-10/msg00000.html
+
 2009-01-07  Werner Lemberg  <wl@gnu.org>
 
 	* docs/CHANGES: Document new key `a' in ftdiff.
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index bea470f..82559b5 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4196,7 +4196,11 @@
 
         faces = &FT_DRIVER(module)->faces_list;
         while ( faces->head )
+	{
           FT_Done_Face( FT_FACE( faces->head->data ) );
+	  if ( faces->head )
+            FT_ERROR(( "FT_Done_Library: failed to free some faces\n" ));
+	}
       }
     }