From da119a30c682c90826720c94d60c2533ddba55aa Mon Sep 17 00:00:00 2001 From: Klaus Silveira Date: Tue, 25 Feb 2025 17:18:08 -0500 Subject: [PATCH] Fix memory deallocation issue by using delete[] for arrays --- neo/idlib/math/Ode.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/neo/idlib/math/Ode.cpp b/neo/idlib/math/Ode.cpp index 2397adcb..662480ac 100644 --- a/neo/idlib/math/Ode.cpp +++ b/neo/idlib/math/Ode.cpp @@ -100,8 +100,8 @@ idODE_Midpoint::~idODE_Midpoint ============= */ idODE_Midpoint::~idODE_Midpoint( void ) { - delete tmpState; - delete derivatives; + delete[] tmpState; + delete[] derivatives; } /* @@ -157,11 +157,11 @@ idODE_RK4::~idODE_RK4 ============= */ idODE_RK4::~idODE_RK4( void ) { - delete tmpState; - delete d1; - delete d2; - delete d3; - delete d4; + delete[] tmpState; + delete[] d1; + delete[] d2; + delete[] d3; + delete[] d4; } /* @@ -230,12 +230,12 @@ idODE_RK4Adaptive::~idODE_RK4Adaptive ============= */ idODE_RK4Adaptive::~idODE_RK4Adaptive( void ) { - delete tmpState; - delete d1; - delete d1half; - delete d2; - delete d3; - delete d4; + delete[] tmpState; + delete[] d1; + delete[] d1half; + delete[] d2; + delete[] d3; + delete[] d4; } /*