From f1fae5ea487a84e5d841cdfc7204a29c1c1f1b31 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Thu, 19 Jun 2008 12:16:20 +0100 Subject: [PATCH] gdiplus: GdipCreatePen2 should make a copy of the brush. --- dlls/gdiplus/pen.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index 9ef14827cbf..f6214f1bcb0 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -88,14 +88,19 @@ GpStatus WINGDIPAPI GdipCreatePen1(ARGB color, REAL width, GpUnit unit, GpPen **pen) { GpBrush *brush; + GpStatus status; + GdipCreateSolidFill(color, (GpSolidFill **)(&brush)); - return GdipCreatePen2(brush, width, unit, pen); + status = GdipCreatePen2(brush, width, unit, pen); + GdipDeleteBrush(brush); + return status; } GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, GpPen **pen) { GpPen *gp_pen; + GpBrush *clone_brush; if(!pen || !brush) return InvalidParameter; @@ -111,7 +116,6 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, gp_pen->miterlimit = 10.0; gp_pen->dash = DashStyleSolid; gp_pen->offset = 0.0; - gp_pen->brush = brush; if(!((gp_pen->unit == UnitWorld) || (gp_pen->unit == UnitPixel))) { FIXME("UnitWorld, UnitPixel only supported units\n"); @@ -119,6 +123,9 @@ GpStatus WINGDIPAPI GdipCreatePen2(GpBrush *brush, REAL width, GpUnit unit, return NotImplemented; } + GdipCloneBrush(brush, &clone_brush); + gp_pen->brush = clone_brush; + *pen = gp_pen; return Ok;