_CrtIsValidHeapPointer的有关问题

_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语句上面就可以输出。请教一下。


------解决方案--------------------
试图 释放无效指针
------解决方案--------------------