mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 736276 - Ensure we can never double addref a cairo scaled font in ScaledFontBase r=mattwoodrow
This commit is contained in:
parent
050d2d58af
commit
d2b4508586
@ -112,6 +112,12 @@ ScaledFontBase::SetCairoScaledFont(cairo_scaled_font_t* font)
|
||||
{
|
||||
MOZ_ASSERT(!mScaledFont);
|
||||
|
||||
if (font == mScaledFont)
|
||||
return;
|
||||
|
||||
if (mScaledFont)
|
||||
cairo_scaled_font_destroy(mScaledFont);
|
||||
|
||||
mScaledFont = font;
|
||||
cairo_scaled_font_reference(mScaledFont);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace gfx {
|
||||
ScaledFontCairo::ScaledFontCairo(cairo_scaled_font_t* aScaledFont, Float aSize)
|
||||
: ScaledFontBase(aSize)
|
||||
{
|
||||
mScaledFont = aScaledFont;
|
||||
SetCairoScaledFont(aScaledFont);
|
||||
}
|
||||
|
||||
#if defined(USE_SKIA) && defined(MOZ_ENABLE_FREETYPE)
|
||||
|
Loading…
Reference in New Issue
Block a user