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:
parent
6a280720d5
commit
3f6714ea7d
1 changed files with 14 additions and 3 deletions
|
|
@ -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))
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue