From b2b0cb2144f39d0fe84a08eb9a3112be3c1daf71 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Sun, 10 Jan 2010 15:52:08 +0000 Subject: [PATCH] Fixed memory leak in sf::Font (reference counter was never initialized) git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1342 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/Graphics/Font.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index 82d181de4..596d72120 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -76,6 +76,7 @@ bool Font::LoadFromFile(const std::string& filename) { // Cleanup the previous resources Cleanup(); + myRefCount = new int(1); // Initialize FreeType // Note: we initialize FreeType for every font instance in order to avoid having a single @@ -115,6 +116,7 @@ bool Font::LoadFromMemory(const char* data, std::size_t sizeInBytes) { // Cleanup the previous resources Cleanup(); + myRefCount = new int(1); // Initialize FreeType // Note: we initialize FreeType for every font instance in order to avoid having a single