2010-06-02 89 views
1

我有一段代碼在VS2008,C++中以調試模式運行。 問題是,當我逐行調試代碼時,在代碼的一個非常奇怪的地方,它崩潰並說:奇怪的崩潰

debug assertion faild。 表達式:_BLOCK_TYPE_IS_VALID(pHead-> nBlockUse)

碰撞點是在第一關閉大括號(後mesh->邊緣並[e] .needsUpdate =假) 我不理解爲什麼在捲曲托架?這對你們有意義嗎?

任何人都可以幫助我理解正在發生什麼.. ..?

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

那麼發生了什麼? – 2010-06-07 02:50:43

回答

1

根據我的經驗,崩潰在大括號中發生意味着崩潰當塊出去的範圍跑析構函數發生了。我會檢查DecEdgePoint的析構函數中發生了什麼。

0

檢查你是否刪除了你使用過的指針。這可能是一個原因。

0

您有一些庫以DEBUG模式編譯,一些以RELEASE模式編譯。