I have been struggling with a memory corruption/crash that causes the message in the subject and humbly ask for your help.
I narrowed down the code to just a few lines hopefully it will be easy to see what is that I'm doing wrong.
Here is the main program
And here is the header that defines the classes and the implementation:
It seems that the crash occurs in the dst of the class Curve. Also, I noticed that it is called when the object "test" is pushed onto the vector.
Curve(int n, double *x)
m_x = new double[n];
delete  m_x;
exampleClassComp() : cv(0,0)
friend class exampleClass;
id = 0;
obj.val = 0.0;
If anyone can offer some insight it would be much appreciated!