读书人

_CrtIsValidHeapPointer的有关问题

发布时间: 2012-02-27 10:00:22 作者: rapoo

_CrtIsValidHeapPointer的问题
源代码的一部分:
Error_code Extended_queue::serve_and_retrieve(Queue_entry &queue_item)
{
if(front == NULL)
return underflow;
Node *old_front = front;
queue_item = old_front->entry;
front = old_front->next;
if(front == NULL)
rear = NULL;

delete old_front;
//cout << "error";


return success;
}
把注释去掉,编译运行,不能输出error,而且弹出一个框说_CrtIsValidHeapPointer(pUserData),
放在delete语句上面就可以输出。请教一下。


[解决办法]
试图 释放无效指针
[解决办法]

读书人网 >C++

热点推荐