// 报错信息如下:
The inferior stopped because it received a signal from the operating system.
Signal name : SIGSEGV
Signal meaning : Segmentation fault
// Debug 调试模式时,报错位置如下:
void QHashData::free_helper(void (*node_delete)(Node *))
{
if (node_delete) {
Node *this_e = reinterpret_cast<Node *>(this);
Node **bucket = reinterpret_cast<Node **>(this->buckets);
int n = numBuckets;
while (n--) {
Node *cur = *bucket++;
while (cur != this_e) {
Node *next = cur->next;
node_delete(cur); // 指向这行代码!
freeNode(cur);
cur = next;
}
}
}
delete [] buckets;
delete this;
}