Fix memory deallocation issue by using delete[] for arrays

This commit is contained in:
Klaus Silveira 2025-02-25 17:14:26 -05:00
parent 15be4c61ff
commit 63eacd9c3d

View file

@ -104,8 +104,8 @@ idODE_Midpoint::~idODE_Midpoint
*/
idODE_Midpoint::~idODE_Midpoint()
{
delete tmpState;
delete derivatives;
delete[] tmpState;
delete[] derivatives;
}
/*
@ -166,11 +166,11 @@ idODE_RK4::~idODE_RK4
*/
idODE_RK4::~idODE_RK4()
{
delete tmpState;
delete d1;
delete d2;
delete d3;
delete d4;
delete[] tmpState;
delete[] d1;
delete[] d2;
delete[] d3;
delete[] d4;
}
/*
@ -246,12 +246,12 @@ idODE_RK4Adaptive::~idODE_RK4Adaptive
*/
idODE_RK4Adaptive::~idODE_RK4Adaptive()
{
delete tmpState;
delete d1;
delete d1half;
delete d2;
delete d3;
delete d4;
delete[] tmpState;
delete[] d1;
delete[] d1half;
delete[] d2;
delete[] d3;
delete[] d4;
}
/*