I'm trying to destruct a vector object within my program...When the destructor is called (during "program exit" operations performed by the CPU), the following error is thrown:
HEAP[Game Engine.exe]: HEAP: Free Heap block 3b9bd0 modified at 3b9bf8 after it was freed
Windows has triggered a breakpoint in Game Engine.exe.
This may be due to a corruption of the heap, which indicates a bug in Game Engine.exe or any of the DLLs it has loaded.
This may also be due to the user pressing F12 while Game Engine.exe has focus.
I understand that the error is thrown because the program tried to access the vector(a vector of pointers to class objects that have already been destroyed). I tried to get around the problem by emptying the vector before its destruction...perhaps I've done it incorrectly, but during debug, the vector appears to be empty(no data)...here is vector object declaration:
and here is how I've destroyed vector object:
enabled = false;
UINT size_t = gObjCharacter.size();
size_t = gObjEntity.size();
size_t = gObjModel.size();
size_t = gObjWeapon.size();
You'll notice that the vector is a member of a class...the class is static(one instance)...the program's "exit operation" destorys static classes last...
Any idea why this problem persists...I'm confident that the vector has been emptied before the error is thrown...also, if I do not fill these vectors, the error is not thrown upon exit...