1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Fixed a leak.

This commit is contained in:
jules 2012-10-05 17:50:17 +01:00
parent 6a280720d5
commit 3f6714ea7d

View file

@ -202,7 +202,7 @@ public:
typefaceName = Font::getDefaultSansSerifFontName();
}
SharedFontInternal (const Typeface::Ptr& face) noexcept
explicit SharedFontInternal (const Typeface::Ptr& face) noexcept
: typefaceName (face->getName()),
typefaceStyle (face->getStyle()),
height (FontValues::defaultFontHeight),
@ -215,6 +215,18 @@ public:
jassert (typefaceName.isNotEmpty());
}
SharedFontInternal (const SharedFontInternal& other) noexcept
: typefaceName (other.typefaceName),
typefaceStyle (other.typefaceStyle),
height (other.height),
horizontalScale (other.horizontalScale),
kerning (other.kerning),
ascent (other.ascent),
underline (other.underline),
typeface (other.typeface)
{
}
bool operator== (const SharedFontInternal& other) const noexcept
{
return height == other.height
@ -253,8 +265,7 @@ Font::Font (const String& typefaceName, const float fontHeight, const int styleF
}
Font::Font (const String& typefaceName, const String& typefaceStyle, float fontHeight)
: font (new SharedFontInternal (typefaceName, typefaceStyle,
FontValues::limitFontHeight (fontHeight), false))
: font (new SharedFontInternal (typefaceName, typefaceStyle, FontValues::limitFontHeight (fontHeight), false))
{
}