Merge pull request #810 from iwilkes1/master
Fixed mismatched new and delete in BussIK VectorRn and MatrixRmn
This commit is contained in:
@@ -181,7 +181,7 @@ inline MatrixRmn::MatrixRmn( long numRows, long numCols )
|
||||
|
||||
inline MatrixRmn::~MatrixRmn()
|
||||
{
|
||||
delete x;
|
||||
delete[] x;
|
||||
}
|
||||
|
||||
// Resize.
|
||||
@@ -191,7 +191,7 @@ inline void MatrixRmn::SetSize( long numRows, long numCols )
|
||||
assert ( numRows>0 && numCols>0 );
|
||||
long newLength = numRows*numCols;
|
||||
if ( newLength>AllocSize ) {
|
||||
delete x;
|
||||
delete[] x;
|
||||
AllocSize = Max(newLength, AllocSize<<1);
|
||||
x = new double[AllocSize];
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ inline VectorRn::VectorRn( long initLength )
|
||||
|
||||
inline VectorRn::~VectorRn()
|
||||
{
|
||||
delete x;
|
||||
delete[] x;
|
||||
}
|
||||
|
||||
// Resize.
|
||||
@@ -113,7 +113,7 @@ inline void VectorRn::SetLength( long newLength )
|
||||
{
|
||||
assert ( newLength>0 );
|
||||
if ( newLength>AllocLength ) {
|
||||
delete x;
|
||||
delete[] x;
|
||||
AllocLength = Max( newLength, AllocLength<<1 );
|
||||
x = new double[AllocLength];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user