Original Post
Just when i think i've got it all down... doh!
Here's the deal - i have a DWORD buffer in a class that i assign values to. However, i get all kinds of problems in the destructor when it goes to delete the buffer.
Example:
//this is in the class
DWORD *m_pwObjectIndices; //member variable for the class in the header
m_pwObjectIndices = new DWORD[36]; //i know the size necessary
for(DWORD nIndex = 0; nIndex < 36; nIndex+=3)
{
m_pwObjectIndices[nIndex] = nIndex;
m_pwObjectIndices[nIndex+1] = nIndex+1;
m_pwObjectIndices[nIndex+2] = nIndex+2;
m_pwObjectIndices[nIndex+3] = nIndex;
m_pwObjectIndices[nIndex+4] = nIndex+2;
m_pwObjectIndices[nIndex+5] = nIndex+3;
}
i understand that what is probably going on is that local variables are assigned to the DWORD buffer, then they are no longer valid after leaving the function. However, i've tried memcpy and some other things, and i still get problems. Weird thing is i don't get memory leaks when i don't delete the buffer.
Any help out there? Thanks!!!
"You call him Dr. Grip, doll!"
[edited by - the_grip on November 5, 2002 3:42:21 AM]