Minor doc fixes, formatting.

This commit is contained in:
Werner Lemberg 2010-08-06 20:07:36 +02:00
parent 445241589d
commit ba95440cd1
2 changed files with 21 additions and 17 deletions

View File

@ -3,10 +3,10 @@
Fix Savannah bug #30648. Fix Savannah bug #30648.
* src/base/ftobjs.c (FT_Done_Library): Specify the order of font * src/base/ftobjs.c (FT_Done_Library): Specify the order of font
drivers in face closing process. Type42 faces should be closed drivers during the face closing process. Type42 faces should be
before TrueType faces, because a Type42 face refers another closed before TrueType faces, because a Type42 face refers to
internal TrueType face which is created from sfnt[] array on the another internal TrueType face which is created from sfnt[] array on
memory. the memory.
2010-08-06 Yuriy Kaminskiy <yumkam@mail.ru> 2010-08-06 Yuriy Kaminskiy <yumkam@mail.ru>
@ -19,7 +19,7 @@
Fix Savannah bug #30658. Fix Savannah bug #30658.
* src/base/ftobjs.c (Mac_Read_POST_Resource): Check the total * src/base/ftobjs.c (Mac_Read_POST_Resource): Check that the total
length of collected POST segments does not overrun the allocated length of collected POST segments does not overrun the allocated
buffer. buffer.

View File

@ -4408,8 +4408,10 @@
if ( library->generic.finalizer ) if ( library->generic.finalizer )
library->generic.finalizer( library ); library->generic.finalizer( library );
/* Close all faces in the library. If we don't do /*
* this, we can have some subtle memory leaks. * Close all faces in the library. If we don't do this, we can have
* some subtle memory leaks.
*
* Example: * Example:
* *
* - the cff font driver uses the pshinter module in cff_size_done * - the cff font driver uses the pshinter module in cff_size_done
@ -4417,35 +4419,37 @@
* opened FT_Face objects managed by the driver are not properly * opened FT_Face objects managed by the driver are not properly
* destroyed, resulting in a memory leak * destroyed, resulting in a memory leak
* *
* Some faces are dependent with other faces, like Type42 faces that * Some faces are dependent on other faces, like Type42 faces that
* depends on TrueType face synthesized internally. * depend on TrueType faces synthesized internally.
* The order of driver should be described in driver_name[]. *
* The order of drivers should be specified in driver_name[].
*/ */
{ {
FT_UInt m, n; FT_UInt m, n;
const char* driver_name[] = { "type42", NULL }; const char* driver_name[] = { "type42", NULL };
for ( m = 0; for ( m = 0;
m < sizeof( driver_name ) / sizeof( driver_name[0] ); m < sizeof ( driver_name ) / sizeof ( driver_name[0] );
m ++ ) m++ )
{ {
for ( n = 0; n < library->num_modules; n++ ) for ( n = 0; n < library->num_modules; n++ )
{ {
FT_Module module = library->modules[n]; FT_Module module = library->modules[n];
const char* module_name = module->clazz->module_name; const char* module_name = module->clazz->module_name;
FT_List faces; FT_List faces;
if ( driver_name[m] && if ( driver_name[m] &&
0 != ft_strcmp( module_name, driver_name[m] ) ) ft_strcmp( module_name, driver_name[m] ) != 0 )
continue; continue;
if ( ( module->clazz->module_flags & FT_MODULE_FONT_DRIVER ) == 0 ) if ( ( module->clazz->module_flags & FT_MODULE_FONT_DRIVER ) == 0 )
continue; continue;
FT_TRACE7(( "FT_Done_Library: close faces for %s\n", module_name )); FT_TRACE7(( "FT_Done_Library: close faces for %s\n", module_name ));
faces = &FT_DRIVER(module)->faces_list;
faces = &FT_DRIVER( module )->faces_list;
while ( faces->head ) while ( faces->head )
{ {
FT_Done_Face( FT_FACE( faces->head->data ) ); FT_Done_Face( FT_FACE( faces->head->data ) );