getBlockTable delete pline

AcDbBlockTable *pBlkTab;
Acad::ErrorStatus es = acdbHostApplicationServices()->workingDatabase()
->getBlockTable(pBlkTab, AcDb::kForWrite);
if (Acad::eOk != es)
{
return AcDbObjectId::kNull;
}

getBlockTable(pBlkTab, AcDb::kForWrite); 当getblocktable 失败后 pblktable 未打开 不需要close;

 

es=pBlkTabRcd->appendAcDbEntity(pline);
if (es != Acad::eOk)
{
pBlkTabRcd->close();
delete(pline);
pline->close();
acutPrintf(_T("\n生成块失败."));
return;
}
pline->close();

pline 添加入块失败时 则CAD未获得pine的操作 应当delete

 

posted @ 2016-04-19 10:01  xzh1993  阅读(226)  评论(0编辑  收藏  举报