gpt4 book ai didi

debugging - 花括号 : debug assertion faild 上的崩溃

转载 作者:行者123 更新时间:2023-12-03 16:03:10 28 4
gpt4 key购买 nike

我有一段代码在 VS2008,C++ 中以 Debug模式运行。
问题是,当我逐行调试代码时,在代码的一个非常奇怪的地方,它崩溃并说:

debug assertion faild. Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)



崩溃点在第一个闭合的大括号上(在 mesh->edges[e].needsUpdate=false; 之后)
我不明白为什么在大括号上?这对你们有意义吗?

到底是怎么回事?
for(int e=0; e<mesh->edges.size(); e++)
{
if(mesh->edges[e].valid && mesh->edges[e].v[0]>=0 && mesh->edges[e].v[1]>=0 &&
mesh->points[mesh->edges[e].v[0]].writable && mesh->points[mesh->edges[e].v[1]].writable)
{
//update v_hat and its corresponding error
DecEdge Current = DecEdge(e);
pair<Point, float> ppf = computeVhat(e);
Current.v_hat = ppf.first;
Current.error = ppf.second;

edgeSoup.push(Current);
mesh->edges[e].needsUpdate=false;
}
}

最佳答案

根据我的经验,在右括号上发生的崩溃意味着崩溃发生在当 block 超出范围时运行的析构函数中。我会检查 DecEdge 的析构函数中发生了什么和 Point .

关于debugging - 花括号 : debug assertion faild 上的崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2954472/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com