diff --git a/SourceCode/Code2026/AecRxBase/GiDrawUtility.cpp b/SourceCode/Code2026/AecRxBase/GiDrawUtility.cpp index bd5121b..094b72c 100644 --- a/SourceCode/Code2026/AecRxBase/GiDrawUtility.cpp +++ b/SourceCode/Code2026/AecRxBase/GiDrawUtility.cpp @@ -235,7 +235,15 @@ AECDLLIMPEXP AcDbEntity* GiDrawUtility::DrawLoft(const AcDbCurve *pTop AcDbRegion *pRegT = createRegion(_pTop); AcDbRegion *pRegB = createRegion(_pBottom); - if (!pRegT || !pRegB) return NULL; + if (!pRegT || !pRegB) + { + DELETE_PTR(pRegT); + DELETE_PTR(pRegB); + DELETE_PTR(_pTop); + DELETE_PTR(_pBottom); + DELETE_PTR(_pLine); + return NULL; + } AcDbEntity *p = DrawLoft(pRegT, pRegB, pLine); @@ -367,6 +375,11 @@ AECDLLIMPEXP AcDbEntity* GiDrawUtility::DrawMesh( const Adesk::UInt32 &rows if (pEnt->createLoftedSolid(vecPLs, vecGuides, &line, op) != Acad::eOk) { DELETE_PTR(pEnt); + delete [] pSection; + for (size_t i = 0; i < vecPLs.length(); ++i) + { + if (vecPLs[i]) DELETE_PTR(vecPLs[i]); + } return NULL; } @@ -430,7 +443,10 @@ AECDLLIMPEXP AcDbEntity* GiDrawUtility::DrawBox(const AcGePoint3d &ptPos AcDb3dSolid *pSolid = new AcDb3dSolid(); if (!pSolid) return NULL; if (Acad::eOk != pSolid->createBox(X, Y, Z)) + { + DELETE_PTR(pSolid); return NULL; + } pSolid->transformBy( RotateAndMove(AcGeVector3d::kZAxis @@ -447,7 +463,10 @@ AECDLLIMPEXP AcDbEntity* GiDrawUtility::DrawSphere(const AcGePoint3d &ptCenter AcDb3dSolid *pSolid = new AcDb3dSolid(); if (!pSolid) return NULL; if (Acad::eOk != pSolid->createSphere(dRadius)) + { + DELETE_PTR(pSolid); return NULL; + } pSolid->transformBy( RotateAndMove(AcGeVector3d::kZAxis @@ -827,6 +846,7 @@ AcDbEntity* GiDrawUtility::DrawPipe(const AcDbCurve *pCurve, double dR) acutPrintf(_T("\n拉伸错误:%d."), es); DELETE_PTR(pSolid); } + DELETE_PTR(pReg); } else {