Skip to content

OpenToonz - An open-source full-featured 2D animation creation software

C

Correct incorrect delete

Campbell Bartonc39a8a4b7573
diff --git a/toonz/sources/common/tvectorimage/tstroke.cpp b/toonz/sources/common/tvectorimage/tstroke.cpp
index 8ef60513e..8b0297277 100644
--- a/toonz/sources/common/tvectorimage/tstroke.cpp
+++ b/toonz/sources/common/tvectorimage/tstroke.cpp
@@ -3559,7 +3559,7 @@ void TCubicStroke::fitCubic3D(const T3DPointD pointsArrayBegin[], int size,
// if (maxError<error)
{
- double *uPrime = 0;
+ double *uPrime = NULL;
for (int i = 0; i < maxIterations; i++) {
// delete uPrime;
uPrime = reparameterize3D(*cubic, pointsArrayBegin, size, u);
@@ -3571,7 +3571,7 @@ void TCubicStroke::fitCubic3D(const T3DPointD pointsArrayBegin[], int size,
maxError =
computeMaxError3D(*cubic, pointsArrayBegin, size, uPrime, splitPoint);
if (maxError < error) {
- delete uPrime;
+ delete[] uPrime;
delete[] u;
m_cubicChunkArray->push_back(cubic);
return;