Been trying to figure this one out all day.
...
_HISTORY tempHist;
for(int i = 0; i < info.LogPerRecs; i++)
{
CString msg;
msg.Format("History #%d being allocated..",i);
log.Write_Log_File(msg);
tempHist = new History();
msg.Format("New History allocated at %d",tempHist);
log.Write_Log_File(msg);
...
Log says...
"
07/22/2010 13:39:56>History #20 being allocated..
07/22/2010 13:39:56>Beginning History Constructor
07/22/2010 13:39:56>Finishing History Constructor
07/22/2010 13:39:56>New History allocated at 13046208
07/22/2010 13:39:56>History #21 being allocated..
07/22/2010 13:39:56>Beginning History Constructor
07/22/2010 13:39:56>Finishing History Constructor
07/22/2010 13:39:56>New History allocated at 13046384
07/22/2010 13:39:56>History #22 being allocated..
"
And then it blows up with an error that says,
"The instruction at "0x7c911689" referenced memory at "0x00000000". The memory could not be "read""
Yet the only blob of code between my log statements is the dynamic allocation, and judging by the addresses of my previous allocations, I'm not exactly scraping the bottom of the barrel on addresses.
History class contains about 35 floats, nothing clever whatsoever inside of it, _HISTORY is a typedef for a pointer to said History class.
Code works fine in debug, has kittens in release. Any thoughts?