From: Hermet Park Date: Fri, 28 Aug 2020 10:16:01 +0000 (+0900) Subject: sw_engine: fix memory leak. X-Git-Tag: submit/tizen/20200830.214225^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad7a57cd3289193d857b86e6e96c84c4540a0b76;p=platform%2Fcore%2Fgraphics%2Ftizenvg.git sw_engine: fix memory leak. free dash outline stroke data memory properly. Change-Id: I25bebc38c2d6d7f69d04f6288a5b6863324b70d6 --- diff --git a/src/lib/sw_engine/tvgSwShape.cpp b/src/lib/sw_engine/tvgSwShape.cpp index d2687de..b738f89 100644 --- a/src/lib/sw_engine/tvgSwShape.cpp +++ b/src/lib/sw_engine/tvgSwShape.cpp @@ -618,11 +618,13 @@ void shapeResetStroke(SwShape* shape, const Shape* sdata, const Matrix* transfor bool shapeGenStrokeRle(SwShape* shape, const Shape* sdata, const Matrix* transform, const SwSize& clip) { SwOutline* shapeOutline = nullptr; + bool freeOutline = false; //Dash Style Stroke if (sdata->strokeDash(nullptr) > 0) { shapeOutline = _genDashOutline(sdata, transform); if (!shapeOutline) return false; + freeOutline = true; //Normal Style stroke } else { if (!shape->outline) { @@ -643,6 +645,7 @@ bool shapeGenStrokeRle(SwShape* shape, const Shape* sdata, const Matrix* transfo shape->strokeRle = rleRender(strokeOutline, bbox, clip, true); + if (freeOutline) _delOutline(shapeOutline); _delOutline(strokeOutline); return true;