From: jfa Date: Mon, 19 Mar 2007 12:26:03 +0000 (+0000) Subject: NPAL15230: Too much memory allocation. X-Git-Tag: V3_2_6pre3~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fc0f3a279c464eb2be62a48ed8c1c647eeaa78a0;p=modules%2Fgeom.git NPAL15230: Too much memory allocation. --- diff --git a/src/GEOMAlgo/GEOMAlgo_Builder.cdl b/src/GEOMAlgo/GEOMAlgo_Builder.cdl index 42eb89e86..967bc05f9 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder.cdl +++ b/src/GEOMAlgo/GEOMAlgo_Builder.cdl @@ -99,6 +99,13 @@ is -- -- protected methods -- + -- + PerformInternal(me:out; + theDSF: DSFiller from NMTTools) + ---Purpose: Performs calculations using prepared DSFiller + -- object theDSF + is protected; + -- PrepareHistory (me:out) ---Purpose: Prepare information for history support is redefined protected; @@ -241,7 +248,7 @@ fields mySameDomainShapes: IndexedDataMapOfShapeShape from TopTools is protected; -- solids myDraftSolids : IndexedDataMapOfShapeShape from TopTools is protected; - + myEntryPoint : Integer from Standard is protected; -- end Builder; diff --git a/src/GEOMAlgo/GEOMAlgo_Builder.cxx b/src/GEOMAlgo/GEOMAlgo_Builder.cxx index 0ab651cde..284cd7b10 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder.cxx @@ -52,6 +52,7 @@ { myNbTypes=9; myDSFiller=NULL; + myEntryPoint=0; // Entry point through PerformWithFiller () } //======================================================================= //function : ~ @@ -59,6 +60,12 @@ //======================================================================= GEOMAlgo_Builder::~GEOMAlgo_Builder() { + if (myEntryPoint==1) { + if (myDSFiller) { + delete myDSFiller; + myDSFiller=NULL; + } + } } //======================================================================= //function : AddCompound @@ -253,18 +260,33 @@ aBB.Add(aCS, aS); } // + if (myDSFiller) { + delete myDSFiller; + myDSFiller=NULL; + } NMTTools_DSFiller* pDSF=new NMTTools_DSFiller; // pDSF->SetCompositeShape(aCS); pDSF->Perform(); // - PerformWithFiller(*pDSF); + myEntryPoint=1; + PerformInternal(*pDSF); } //======================================================================= //function : PerformWithFiller //purpose : //======================================================================= void GEOMAlgo_Builder::PerformWithFiller(const NMTTools_DSFiller& theDSF) +{ + myEntryPoint=0; + // + PerformInternal(theDSF); +} +//======================================================================= +//function : PerformInternal +//purpose : +//======================================================================= + void GEOMAlgo_Builder::PerformInternal(const NMTTools_DSFiller& theDSF) { myErrorStatus=0; // diff --git a/src/GEOMAlgo/GEOMAlgo_Builder.hxx b/src/GEOMAlgo/GEOMAlgo_Builder.hxx index b6bc2e9e1..2f38d77fb 100644 --- a/src/GEOMAlgo/GEOMAlgo_Builder.hxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder.hxx @@ -137,6 +137,10 @@ protected: // Methods PROTECTED // +//! Performs calculations using prepared DSFiller
+//! object theDSF
+Standard_EXPORT void PerformInternal(const NMTTools_DSFiller& theDSF) ; + //! Prepare information for history support
Standard_EXPORT virtual void PrepareHistory() ; @@ -220,6 +224,7 @@ TopTools_IndexedDataMapOfShapeListOfShape myInParts; BRepAlgo_Image mySplitFaces; TopTools_IndexedDataMapOfShapeShape mySameDomainShapes; TopTools_IndexedDataMapOfShapeShape myDraftSolids; +Standard_Integer myEntryPoint; private: