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
This commit is contained in:
LaurentGom 2010-01-10 15:52:08 +00:00
parent 327cfe4ec6
commit b2b0cb2144

View File

@ -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