Original Post
Hey, whenever I run this function below I get this error, at the line specified: "Unhandled exception in Program.exe: at 0xC0000005: Access Violation:" Well, I know becasue of the 0xC0000005 that the problem is with a pointer not pointing at anything, but I do not see what is wrong with my code.
Well if you could help I would appreciate it. THanks
// Delete TileTypes
void RemoveNode(TileType *Node) {
// Release DirectDraw Surface
Node->lpddTileSurface->Release();
Node->lpddTileSurface = NULL;
// Remove from list
if(Node->pPrev == NULL)
TileType::pFirst = Node->pNext;
else
Node->pPrev->pNext = Node->pNext; // This line screws up.
if(Node->pNext == NULL)
TileType::pLast = Node->pPrev;
else
Node->pNext->pPrev = Node->pPrev;
delete Node;
Node = NULL;
}
|