解决 after Normal block(#908) at 0x399EC0. CRT detected that the application wrote to memory after end of heap buffer 内存出错 1. 数组越界所导致 char* pBuffer = new char[2]; int v = 123; strcpy(pBuffer, &v); delete[] pBuffer; 2. 释放过的内存没有置为0,也就是就是野指针的问题 if (this-&g…
今天调试测试代码时,发现在用完了new出来的内存buf后,在执行delete时报错了,具体信息为: HEAP_CORRUPTION_DETECTED: after Normal block(#908) at 0x399EC0. CRT detected that the application wrote to memory after end of heap buffer . 经仔细查阅代码,是new出来的buf操作越界了,导致delete时出现这样的错误. 一般出现此类情况,都是对new出来…