问题起因:
当我自己的一大堆代码里面包含有很多delete指针的操作, 但是其中某些delete是非法的,
所以在调试的时候, 调试器会定位到 “dbgdel.cpp” 中的以下这一条断言
void operator delete( void *pUserData )
{
_CrtMemBlockHeader * pHead;
RTCCALLBACK(_RTC_Free_hook, (pUserData, 0));
if (pUserData == NULL)
return;
_mlock(_HEAP_LOCK); /* block other threads */
__TRY
/* get a pointer to memory block header */
pHead = pHdr(pUserData);
/* verify block type */
_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));
_free_dbg( pUserData, pHead->nBlockUse );
__FINALLY
_munlock(_HEAP_LOCK); /* release other threads */
__END_TRY_FINALLY
return;
}
_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse));
此时Autos窗口会显示被删除出错的那个内存地址pUserData
此时我应该怎样才能快速定位到当前处理我自己的代码中的哪个delete?
我不想给每个delete打上断点。