From 753c02e96be417c81edf2fd2e17a169958222f3e Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Mon, 2 May 2011 14:49:25 +0100 Subject: [PATCH] Fix memory leak in font loading --- src/Font.cpp | 4 +++- src/Font.hpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Font.cpp b/src/Font.cpp index 9536e2c..74eed55 100644 --- a/src/Font.cpp +++ b/src/Font.cpp @@ -1,6 +1,6 @@ // // Font.cpp -- A wrapper around FreeType. -// Copyright (C) 2006 Nick Gasson +// Copyright (C) 2006, 2011 Nick Gasson // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -165,6 +165,8 @@ void Font::MakeDisplayList(FT_Face face, char ch, GLuint listBase, // Finish display list glEndList(); + + FT_Done_Glyph(glyph); } void Font::SplitIntoLines(vector &lines, const char* fmt, va_list ap) diff --git a/src/Font.hpp b/src/Font.hpp index 9457d91..5e48a46 100644 --- a/src/Font.hpp +++ b/src/Font.hpp @@ -1,6 +1,6 @@ // // FreeType.hpp -- A wrapper around FreeType. -// Copyright (C) 2006 Nick Gasson +// Copyright (C) 2006, 2011 Nick Gasson // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by -- 2.39.2