Debug assertion failed BLOCK_TYPE_IS_VALID(pHead->nblockuse) from Deconstructor

前端 未结 2 605
时光说笑
时光说笑 2021-01-27 05:06

I am quite lost right now. I made a vector class. Everything works how I would like it to work, until the end. When the destructor is called I get an error message: Debug ass

2条回答
  •  滥情空心
    2021-01-27 05:53

    The error means heap corruption. There are lots of ways to corrupt a heap. Like David explained above, freeing a chunk of memory and then writing to it is one way.

    Most heaps store some bytes of bookkeeping information before and after your chunk of memory. If your code misbehaves and changes the heaps data, you get this type of error.

提交回复
热议问题