From e1cc1199bbea7597ba7134a7170fe14c2e606632 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Fri, 4 Nov 2022 18:43:20 +0800 Subject: [PATCH] Fix error: 'delete' applied to a pointer that was allocated with 'new[]'; did you mean 'delete[]'? Signed-off-by: Xiang Xiao --- graphics/nxwidgets/src/cgraphicsport.cxx | 8 ++++---- graphics/nxwidgets/src/cimage.cxx | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/graphics/nxwidgets/src/cgraphicsport.cxx b/graphics/nxwidgets/src/cgraphicsport.cxx index cac72d395..0b72d0f61 100644 --- a/graphics/nxwidgets/src/cgraphicsport.cxx +++ b/graphics/nxwidgets/src/cgraphicsport.cxx @@ -579,7 +579,7 @@ void CGraphicsPort::drawBitmapGreyScale(nxgl_coord_t x, nxgl_coord_t y, src += bitmap->stride; } - delete run; + delete[] run; } /** @@ -824,7 +824,7 @@ void CGraphicsPort::_drawText(struct nxgl_point_s *pos, CRect *bound, pos->x += fontWidth; } - delete glyph; + delete[] glyph; } /** @@ -962,7 +962,7 @@ void CGraphicsPort::greyScale(nxgl_coord_t x, nxgl_coord_t y, &origin, rowBitmap.stride) ; } - delete rowBuffer; + delete[] rowBuffer; } /** @@ -1038,5 +1038,5 @@ void CGraphicsPort::invert(nxgl_coord_t x, nxgl_coord_t y, &origin, rowBitmap.stride) ; } - delete rowBuffer; + delete[] rowBuffer; }; diff --git a/graphics/nxwidgets/src/cimage.cxx b/graphics/nxwidgets/src/cimage.cxx index da33a690e..4b02a8bd9 100644 --- a/graphics/nxwidgets/src/cimage.cxx +++ b/graphics/nxwidgets/src/cimage.cxx @@ -254,7 +254,7 @@ void CImage::drawContents(CGraphicsPort *port, bool selected) if (!m_bitmap->getRun(0, srcRow, nLeftPixels, &buffer[m_origin.x])) { ginfo("IBitmap::getRun failed at image row %d\n", srcRow); - delete buffer; + delete[] buffer; return; } @@ -325,7 +325,7 @@ void CImage::drawContents(CGraphicsPort *port, bool selected) } } - delete buffer; + delete[] buffer; } /**