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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
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 );
}