btleader 发表于 2007-6-13 10:15:00

[求助]删除新建的AcDbDatabase对象时出错

<p>&nbsp;char fullfileName;<br/>&nbsp; strcpy(fullfileName,"hzb.dwg");<br/>&nbsp; AcDbDatabase* pCurDb;<br/>&nbsp; pCurDb=acdbCurDwg();<br/>&nbsp; Acad::ErrorStatus es;<br/>&nbsp; AcDbDatabase* pDb = new AcDbDatabase(Adesk::kFalse);<br/>&nbsp; es=pDb-&gt;readDwgFile(fullfileName);<br/>&nbsp; if(es!=Acad::eOk)<br/>&nbsp; {<br/>&nbsp;&nbsp; ads_printf("\n The %c file was not found. ",fullfileName);<br/>&nbsp;&nbsp; delete pDb;<br/>&nbsp;&nbsp; return es;<br/>&nbsp; }</p><p>es=pCurDb-&gt;insert(AcGeMatrix3d::kIdentity,pDb);<br/>&nbsp; if( es!= Acad::eOk)<br/>&nbsp; {<br/>&nbsp;&nbsp; delete pCurDb;<br/>&nbsp;&nbsp; return es;<br/>&nbsp; }</p><p>&nbsp; delete pDb;<br/>&nbsp; return es;</p><p>为什么执行到 delete pDb就报错提示“致命错误:heap error”,其它部分执行正常,这段代码从网上摘抄的,不只哪位大侠知道原因,在下不胜感激,我用的是Autocad R14.</p>
页: [1]
查看完整版本: [求助]删除新建的AcDbDatabase对象时出错