Original Post
Hello everyone. I am working on a small game (student project) and I am getting a runtime error :- "Debug Assertion Failed. dbgdel.cpp line 47" "_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" The top of the call stack looks like :- CreateDevice.exe!operator delete(void * pUserData=0x076ebf48) Line 52 + 0x51 bytes C++ CreateDevice.exe!std::allocator<double>::deallocate(double * _Ptr=0x076ebf48, unsigned int __formal=6) Line 141 + 0x9 bytes C++ CreateDevice.exe!std::vector<double,std::allocator<double> >::_Tidy() Line 1098 C++ CreateDevice.exe!std::vector<double,std::allocator<double>>::~vector<double,std::allocator<double> >() Line 547 C++ CreateDevice.exe!Neuron::~Neuron() Line 32 + 0x12 bytes C++ CreateDevice.exe!Neuron::`scalar deleting destructor'() + 0x14 bytes C++ CreateDevice.exe!std::_Destroy<Neuron>(Neuron * _Ptr=0x076e07b0) Line 61 C++ CreateDevice.exe!std::allocator<Neuron>::destroy(Neuron * _Ptr=0x076e07b0) Line 161 + 0x9 bytes C++ CreateDevice.exe!std::_Destroy_range<Neuron,std::allocator<Neuron> >(Neuron * _First=0x076e07b0, Neuron * _Last=0x076e0840, std::allocator<Neuron> & _Al={...}, std::_Nonscalar_ptr_iterator_tag __formal={...}) Line 235 + 0xc bytes C++ CreateDevice.exe!std::_Destroy_range<Neuron,std::allocator<Neuron> >(Neuron * _First=0x076e07b0, Neuron * _Last=0x076e0840, std::allocator<Neuron> & _Al={...}) Line 226 + 0x28 bytes C++ CreateDevice.exe!std::vector<Neuron,std::allocator<Neuron> >::_Destroy(Neuron * _First=0x076e07b0, Neuron * _Last=0x076e0840) Line 1083 + 0x14 bytes C++ CreateDevice.exe!std::vector<Neuron,std::allocator<Neuron> >::erase(std::_Vector_iterator<Neuron,std::allocator<Neuron> > _First={m_uiNumInputs=6 m_vecWeight=[0]() }, std::_Vector_iterator<Neuron,std::allocator<Neuron> > _Last={m_uiNumInputs=-33686019 m_vecWeight=[3760332834](...,...) }) Line 1024 C++ CreateDevice.exe!std::vector<Neuron,std::allocator<Neuron> >::clear() Line 1035 + 0x48 bytes C++ CreateDevice.exe!NeuralNetworkLayer::~NeuralNetworkLayer() Line 85 C++ The code where the error pops-up is in a loop. The error is encountered in the second iteration (which I find a little weird). I am using MSVC++ 2005 express and DirectX 9 (oct 2005). Please somebody shed some light on it. Thanx. PS - I can paste code snippets on request or mail the whole code.