From Gabor Dorka, Fixes to memory leaks.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user