From Gabor Dorka, Fixes to memory leaks.

This commit is contained in:
Robert Osfield
2002-10-10 09:00:31 +00:00
parent 16291da3b0
commit 41893927c1
4 changed files with 22 additions and 5 deletions

View File

@@ -24,8 +24,11 @@ FTBitmapGlyph::FTBitmapGlyph( FT_Glyph glyph)
int srcHeight = source->rows;
int srcPitch = source->pitch;
if (srcPitch*srcHeight==0) return;
if (srcPitch*srcHeight==0)
{
FT_Done_Glyph( glyph );
return;
}
pos.x = bitmap->left;
pos.y = srcHeight - bitmap->top;

View File

@@ -15,6 +15,7 @@ FTOutlineGlyph::FTOutlineGlyph( FT_Glyph glyph)
{
if( ft_glyph_format_outline != glyph->format)
{
FT_Done_Glyph( glyph);
return;
}
@@ -27,6 +28,7 @@ FTOutlineGlyph::FTOutlineGlyph( FT_Glyph glyph)
if (numContours==0)
{
FT_Done_Glyph( glyph);
return;
}
@@ -50,7 +52,10 @@ FTOutlineGlyph::FTOutlineGlyph( FT_Glyph glyph)
vectoriser=0;
if ( ( numContours < 1) || ( numPoints < 3))
{
FT_Done_Glyph( glyph);
return;
}
glList = glGenLists(1);
int d = 0;

View File

@@ -27,8 +27,11 @@ FTPixmapGlyph::FTPixmapGlyph( FT_Glyph glyph)
int srcHeight = source->rows;
int srcPitch = source->pitch;
if (srcWidth*srcHeight==0) return;
if (srcWidth*srcHeight==0)
{
FT_Done_Glyph( glyph );
return;
}
numGreys = source->num_grays;
pos.x = bitmap->left;

View File

@@ -64,7 +64,10 @@ FTPolyGlyph::FTPolyGlyph( FT_Glyph glyph)
glList(0)
{
if( ft_glyph_format_outline != glyph->format)
{ return;}
{
FT_Done_Glyph( glyph );
return;
}
advance = glyph->advance.x >> 16;
@@ -96,7 +99,10 @@ FTPolyGlyph::FTPolyGlyph( FT_Glyph glyph)
vectoriser=0; // delete it, using ref_ptr.
if ( ( numContours < 1) || ( numPoints < 3))
{
FT_Done_Glyph( glyph );
return;
}
Tesselate();