Bug 903732 - Stop leaking gfxPattern objects when using CSS text frames. r=dholbert

This commit is contained in:
Robert Longson 2013-08-12 19:39:08 +01:00
parent 55ccfb3702
commit f329519406

View File

@ -5481,10 +5481,12 @@ nsSVGTextFrame2::SetupInheritablePaint(gfxContext* aContext,
aFillOrStroke);
aTargetPaint.SetColor(color);
aContext->SetPattern(new gfxPattern(gfxRGBA(NS_GET_R(color) / 255.0,
NS_GET_G(color) / 255.0,
NS_GET_B(color) / 255.0,
NS_GET_A(color) / 255.0 * aOpacity)));
nsRefPtr<gfxPattern> pattern =
new gfxPattern(gfxRGBA(NS_GET_R(color) / 255.0,
NS_GET_G(color) / 255.0,
NS_GET_B(color) / 255.0,
NS_GET_A(color) / 255.0 * aOpacity));
aContext->SetPattern(pattern);
}
}