From 2b8347c0d8a68ee506c86a99c6e9bc8aef0f83c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 20 Oct 2005 09:51:56 +0000 Subject: [PATCH] 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 --- .../drawing/Painter/font_support/agg_font_freetype.cpp | 10 ++-------- .../drawing/Painter/font_support/agg_font_freetype.h | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/servers/app/drawing/Painter/font_support/agg_font_freetype.cpp b/src/servers/app/drawing/Painter/font_support/agg_font_freetype.cpp index 3c860dffe0..5e62f2f103 100644 --- a/src/servers/app/drawing/Painter/font_support/agg_font_freetype.cpp +++ b/src/servers/app/drawing/Painter/font_support/agg_font_freetype.cpp @@ -417,7 +417,6 @@ namespace agg font_engine_freetype_base::~font_engine_freetype_base() { delete [] m_face_ids; - delete [] m_faces; delete [] m_signature; } @@ -437,7 +436,6 @@ namespace agg m_hinting(true), m_flip_y(false), m_library(library), - m_faces(new FT_Face [max_faces]), m_face_ids(new unsigned [max_faces]), m_num_faces(0), m_max_faces(max_faces), @@ -503,25 +501,21 @@ namespace agg int idx = find_face(font.GetFamilyAndStyle()); if(idx >= 0) { - m_cur_face = m_faces[idx]; + m_cur_face = font.GetFTFace(); m_cur_id = m_face_ids[idx]; } else { if(m_num_faces >= m_max_faces) { - memcpy(m_faces, - m_faces + 1, - (m_max_faces - 1) * sizeof(FT_Face)); memcpy(m_face_ids, m_face_ids + 1, (m_max_faces - 1) * sizeof(unsigned)); m_num_faces = m_max_faces - 1; } - m_faces[m_num_faces] = font.GetFTFace(); 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_num_faces; } diff --git a/src/servers/app/drawing/Painter/font_support/agg_font_freetype.h b/src/servers/app/drawing/Painter/font_support/agg_font_freetype.h index 003ef9fa2c..9d078fb6f8 100644 --- a/src/servers/app/drawing/Painter/font_support/agg_font_freetype.h +++ b/src/servers/app/drawing/Painter/font_support/agg_font_freetype.h @@ -126,7 +126,6 @@ namespace agg bool m_flip_y; bool m_library_initialized; FT_Library m_library; // handle to library - FT_Face* m_faces; // A pool of font faces unsigned* m_face_ids; unsigned m_num_faces; unsigned m_max_faces;