Hey,
I got the following problem.
I got 2 methods, each part of a different class
GPA Forge()
{
GPA Result=GPA(xtotal,ytotal);
for (int n=0;n<=X;n++){
for (int m=0;m<=Y;m++){
GPA Source =(*this)[n][m];
Result.Insert(Source,0,0,n*xrange,m*yrange,xrange,yrange);
}
}
return Result;
}
and
void Insert (GPA Source,int xSource, int ySource,int xHere, int yHere, int xArea,int yArea)
{
for(int m=0;m<yArea;m++){
for(int n=0;n<xArea;n++){
(*this)[xHere+n][yHere+m]=Source[xSource+n][ySource+m];
}
}
}
both functions work in the current form. However, after Insert(...) is complete for the first run, the GPA destructor
~GPA()
{
delete [] Addr;
}
is run twice instead of once due to some reason. The second run, causes a "BLOCK ASSERT FAILED..." and crashes the application.
I'd appreciate ideas on how to fix this.
Thanks in advance