Error in user guide
Posted: Wed Jun 26, 2019 6:39 pm
Hi folks.
I'm kind of surprised about these lines in flowstone user guide, and also with provided helper functions.
if we use a new [] we need to use delete[]. Could be serious memory issue, if you leak an array of size N at each function call...
I'm kind of surprised about these lines in flowstone user guide, and also with provided helper functions.
if we use a new [] we need to use delete[]. Could be serious memory issue, if you leak an array of size N at each function call...
Code: Select all
// Delete previous array and reset pOut entry
if( pOut[x] )
{
delete *((int**)&pOut[x]);
pOut[x] = 0;
}
// Create new array (assume we have declared 'length' – add 1 for size at front)
int* array = new int[length+1];