Commit 603292d7b0b2f391bcb11785a74a0b26fd727595

Behdad Esfahbod 2015-01-14T18:35:56

[base] Don't initialize unused `driver->glyph_loader'. * src/base/ftobjs.c (Destroy_Driver): Don't call `FT_GlyphLoader_Done'. (FT_Add_Module): Don't call `FT_GlyphLoader_New'.

diff --git a/ChangeLog b/ChangeLog
index 6aca637..62bb099 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2015-01-14  Behdad Esfahbod  <behdad@behdad.org>
 
+	[base] Don't initialize unused `driver->glyph_loader'.
+
+	* src/base/ftobjs.c (Destroy_Driver): Don't call
+	`FT_GlyphLoader_Done'.
+	(FT_Add_Module): Don't call `FT_GlyphLoader_New'.
+
+2015-01-14  Behdad Esfahbod  <behdad@behdad.org>
+
 	[base] Don't allocate `library->raster_pool' anymore.
 
 	It's unused after the following commits:
diff --git a/include/internal/ftobjs.h b/include/internal/ftobjs.h
index b45a5ed..2014a95 100644
--- a/include/internal/ftobjs.h
+++ b/include/internal/ftobjs.h
@@ -740,9 +740,8 @@ FT_BEGIN_HEADER
   /*     faces_list   :: The list of faces currently opened by this        */
   /*                     driver.                                           */
   /*                                                                       */
-  /*     glyph_loader :: The glyph loader for all faces managed by this    */
-  /*                     driver.  This object isn't defined for unscalable */
-  /*                     formats.                                          */
+  /*     glyph_loader :: Unused.  Used to be glyph loader for all faces    */
+  /*                     managed by this driver.                           */
   /*                                                                       */
   typedef struct  FT_DriverRec_
   {
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index ba5a24b..d3a1209 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -968,10 +968,6 @@
                       (FT_List_Destructor)destroy_face,
                       driver->root.memory,
                       driver );
-
-    /* check whether we need to drop the driver's glyph loader */
-    if ( FT_DRIVER_USES_OUTLINES( driver ) )
-      FT_GlyphLoader_Done( driver->glyph_loader );
   }
 
 
@@ -4313,17 +4309,10 @@
     /* if the module is a font driver */
     if ( FT_MODULE_IS_DRIVER( module ) )
     {
-      /* allocate glyph loader if needed */
       FT_Driver  driver = FT_DRIVER( module );
 
 
       driver->clazz = (FT_Driver_Class)module->clazz;
-      if ( FT_DRIVER_USES_OUTLINES( driver ) )
-      {
-        error = FT_GlyphLoader_New( memory, &driver->glyph_loader );
-        if ( error )
-          goto Fail;
-      }
     }
 
     if ( clazz->module_init )
@@ -4340,15 +4329,6 @@
     return error;
 
   Fail:
-    if ( FT_MODULE_IS_DRIVER( module ) )
-    {
-      FT_Driver  driver = FT_DRIVER( module );
-
-
-      if ( FT_DRIVER_USES_OUTLINES( driver ) )
-        FT_GlyphLoader_Done( driver->glyph_loader );
-    }
-
     if ( FT_MODULE_IS_RENDERER( module ) )
     {
       FT_Renderer  renderer = FT_RENDERER( module );