A weird crash...

Posted by Nima on Stack Overflow See other posts from Stack Overflow or by Nima
Published on 2010-06-02T01:35:00Z Indexed on 2010/06/02 3:03 UTC
Read the original article Hit count: 273

Filed under:
|
|

Hi,

I have a piece of code that runs in debug mode in VS2008, C++. The problem is that when I am debugging the code line by line, at a very weird point of the code, it crashes and says:

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

The crash point is on the first closed curly bracket (after mesh->edges[e].needsUpdate=false;) I don't understand why on a curly bracket? does that make sense to you guys?

Can anybody help me understanding what is going on..?

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;
    }
}

© Stack Overflow or respective owner

Related posts about debugging

Related posts about crash