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:
parent
327cfe4ec6
commit
b2b0cb2144
1 changed files with 2 additions and 0 deletions
|
@ -76,6 +76,7 @@ bool Font::LoadFromFile(const std::string& filename)
|
||||||
{
|
{
|
||||||
// Cleanup the previous resources
|
// Cleanup the previous resources
|
||||||
Cleanup();
|
Cleanup();
|
||||||
|
myRefCount = new int(1);
|
||||||
|
|
||||||
// Initialize FreeType
|
// Initialize FreeType
|
||||||
// Note: we initialize FreeType for every font instance in order to avoid having a single
|
// 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 the previous resources
|
||||||
Cleanup();
|
Cleanup();
|
||||||
|
myRefCount = new int(1);
|
||||||
|
|
||||||
// Initialize FreeType
|
// Initialize FreeType
|
||||||
// Note: we initialize FreeType for every font instance in order to avoid having a single
|
// Note: we initialize FreeType for every font instance in order to avoid having a single
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue