From c63f58cfe12267c2c0762757397acb5d2855a55f8ec3e80b4c85d04573d0ad98 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 9 Aug 2025 19:07:36 -0400 Subject: [PATCH] Another local ersatz vector cleaned. --- dw/types.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dw/types.cc b/dw/types.cc index be27005..b42e22f 100644 --- a/dw/types.cc +++ b/dw/types.cc @@ -141,15 +141,14 @@ void Polygon::draw (core::View *view, core::style::Style *style, int x, int y) if (points->size()) { int i; const bool filled = false, convex = false; - Point *pointArray = (Point *)malloc(points->size()*sizeof(struct Point)); + std::vector< Point > pointArray( points->size() ); for (i = 0; i < points->size(); i++) { pointArray[i].x = x + points->getRef(i)->x; pointArray[i].y = y + points->getRef(i)->y; } view->drawPolygon(style->color, core::style::Color::SHADING_NORMAL, - filled, convex, pointArray, i); - free(pointArray); + filled, convex, pointArray.data(), i); } }