don't use potentially stall freetype font face handles. The code is
more correct now, but it doesn't actually fix anything, since FT_Face handles are nowhere freed in the app_server code. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14447 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -417,7 +417,6 @@ namespace agg
|
|||||||
font_engine_freetype_base::~font_engine_freetype_base()
|
font_engine_freetype_base::~font_engine_freetype_base()
|
||||||
{
|
{
|
||||||
delete [] m_face_ids;
|
delete [] m_face_ids;
|
||||||
delete [] m_faces;
|
|
||||||
delete [] m_signature;
|
delete [] m_signature;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -437,7 +436,6 @@ namespace agg
|
|||||||
m_hinting(true),
|
m_hinting(true),
|
||||||
m_flip_y(false),
|
m_flip_y(false),
|
||||||
m_library(library),
|
m_library(library),
|
||||||
m_faces(new FT_Face [max_faces]),
|
|
||||||
m_face_ids(new unsigned [max_faces]),
|
m_face_ids(new unsigned [max_faces]),
|
||||||
m_num_faces(0),
|
m_num_faces(0),
|
||||||
m_max_faces(max_faces),
|
m_max_faces(max_faces),
|
||||||
@@ -503,25 +501,21 @@ namespace agg
|
|||||||
int idx = find_face(font.GetFamilyAndStyle());
|
int idx = find_face(font.GetFamilyAndStyle());
|
||||||
if(idx >= 0)
|
if(idx >= 0)
|
||||||
{
|
{
|
||||||
m_cur_face = m_faces[idx];
|
m_cur_face = font.GetFTFace();
|
||||||
m_cur_id = m_face_ids[idx];
|
m_cur_id = m_face_ids[idx];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(m_num_faces >= m_max_faces)
|
if(m_num_faces >= m_max_faces)
|
||||||
{
|
{
|
||||||
memcpy(m_faces,
|
|
||||||
m_faces + 1,
|
|
||||||
(m_max_faces - 1) * sizeof(FT_Face));
|
|
||||||
memcpy(m_face_ids,
|
memcpy(m_face_ids,
|
||||||
m_face_ids + 1,
|
m_face_ids + 1,
|
||||||
(m_max_faces - 1) * sizeof(unsigned));
|
(m_max_faces - 1) * sizeof(unsigned));
|
||||||
m_num_faces = m_max_faces - 1;
|
m_num_faces = m_max_faces - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_faces[m_num_faces] = font.GetFTFace();
|
|
||||||
m_face_ids[m_num_faces] = font.GetFamilyAndStyle();
|
m_face_ids[m_num_faces] = font.GetFamilyAndStyle();
|
||||||
m_cur_face = m_faces[m_num_faces];
|
m_cur_face = font.GetFTFace();
|
||||||
m_cur_id = m_face_ids[m_num_faces];
|
m_cur_id = m_face_ids[m_num_faces];
|
||||||
++m_num_faces;
|
++m_num_faces;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ namespace agg
|
|||||||
bool m_flip_y;
|
bool m_flip_y;
|
||||||
bool m_library_initialized;
|
bool m_library_initialized;
|
||||||
FT_Library m_library; // handle to library
|
FT_Library m_library; // handle to library
|
||||||
FT_Face* m_faces; // A pool of font faces
|
|
||||||
unsigned* m_face_ids;
|
unsigned* m_face_ids;
|
||||||
unsigned m_num_faces;
|
unsigned m_num_faces;
|
||||||
unsigned m_max_faces;
|
unsigned m_max_faces;
|
||||||
|
|||||||
Reference in New Issue
Block a user