Commit b33b856a2753a1b4a23fdac658116883fd9bf7f1

Eugene A. Shatokhin 2010-07-05T22:36:30

Fix Savannah bug #27648. * src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call `raster_done' only if we have an outline glyph format. Fix comment typo.

diff --git a/ChangeLog b/ChangeLog
index 051d4a4..daff652 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-07-05  Eugene A. Shatokhin  <spectre@ispras.ru>
+
+	Fix Savannah bug #27648.
+
+	* src/base/ftobjs.c (ft_remove_renderer, FT_Add_Module): Call
+	`raster_done' only if we have an outline glyph format.
+
 2010-07-05  Werner Lemberg  <wl@gnu.org>
 
 	Fix Savannah bug #30030.
diff --git a/include/freetype/ftrender.h b/include/freetype/ftrender.h
index 41c31ea..e06a814 100644
--- a/include/freetype/ftrender.h
+++ b/include/freetype/ftrender.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType renderer modules public interface (specification).          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2005, 2006 by                                     */
+/*  Copyright 1996-2001, 2005, 2006, 2010 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -141,10 +141,6 @@ FT_BEGIN_HEADER
   /*    raster_class    :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */
   /*                       This is a pointer to its raster's class.        */
   /*                                                                       */
-  /*    raster          :: For @FT_GLYPH_FORMAT_OUTLINE renderers only.    */
-  /*                       This is a pointer to the corresponding raster   */
-  /*                       object, if any.                                 */
-  /*                                                                       */
   typedef struct  FT_Renderer_Class_
   {
     FT_Module_Class            root;
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 8551693..7d9dc3d 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -3739,7 +3739,7 @@
 
       /* allocate raster object if needed */
       if ( clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&
-           clazz->raster_class->raster_new )
+           clazz->raster_class->raster_new                )
       {
         error = clazz->raster_class->raster_new( memory, &render->raster );
         if ( error )
@@ -3780,7 +3780,8 @@
 
 
       /* release raster object, if any */
-      if ( render->raster )
+      if ( render->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE &&
+           render->raster                                         )
         render->clazz->raster_class->raster_done( render->raster );
 
       /* remove from list */
@@ -4107,7 +4108,8 @@
       FT_Renderer  renderer = FT_RENDERER( module );
 
 
-      if ( renderer->raster )
+      if ( renderer->clazz->glyph_format == FT_GLYPH_FORMAT_OUTLINE && 
+           renderer->raster                                         )
         renderer->clazz->raster_class->raster_done( renderer->raster );
     }