Pb with array of classes


#1

Hello

Me again, sorry.

I have an exception raised by Juce when I’m trying to delete an array, i.e. calling

delete[] peaksArray;

Of course peaksArray is not NULL at that point.

My array is defined as

where

// structure to store min & max points of a block class BlockMinMax { public: float min; float max; };

Any idea ?
Maybe I shouldn’t use the new operator with arrays ?
I saw the juce_malloc macro but doesn’t know it I must use something else than new for arrays of classes.

thanks

geoffroy


#2

Forget it! A newbie problem.
I just had written past the end of the array before killing it…

sorry


#3