From: emv Date: Wed, 10 Apr 2013 11:05:50 +0000 (+0400) Subject: 0023882: Memory leak is reported on BOP in test bugs fclasses bug7287_5. X-Git-Tag: V6_6_0~24 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=5d05cf31f0263643631fda85b4355a4442493549 0023882: Memory leak is reported on BOP in test bugs fclasses bug7287_5. Test cases which check Boolean Operation algorithm on memory leaks have been rewritten to test the whole algorithm and not a part of it. --- diff --git a/src/BOPTest/BOPTest_BOPCommands.cxx b/src/BOPTest/BOPTest_BOPCommands.cxx index 8331f758d9..b156207fe5 100755 --- a/src/BOPTest/BOPTest_BOPCommands.cxx +++ b/src/BOPTest/BOPTest_BOPCommands.cxx @@ -139,11 +139,12 @@ Standard_Integer bop (Draw_Interpretor& di, Standard_Integer n, const char** a) aLC.Append(aS1); aLC.Append(aS2); // - if (!pPF) { + if (pPF!=NULL) { delete pPF; - Handle(NCollection_BaseAllocator)aAL=new NCollection_IncAllocator; - pPF=new BOPAlgo_PaveFiller(aAL); + pPF=NULL; } + Handle(NCollection_BaseAllocator)aAL=new NCollection_IncAllocator; + pPF=new BOPAlgo_PaveFiller(aAL); // pPF->SetArguments(aLC); // diff --git a/tests/bugs/fclasses/bug7287_1 b/tests/bugs/fclasses/bug7287_1 index eb27774205..6bcc66283b 100755 --- a/tests/bugs/fclasses/bug7287_1 +++ b/tests/bugs/fclasses/bug7287_1 @@ -12,13 +12,13 @@ puts "" set BugNumber OCC7287 -set NCycles 1000 +set NCycles 100 box b1 100 100 100 box b2 50 50 50 -bop b1 b2 set listmem {} for {set i 1} {${i} <= ${NCycles}} {incr i } { + bop b1 b2 bopcut r lappend listmem [meminfo h] diff --git a/tests/bugs/fclasses/bug7287_2 b/tests/bugs/fclasses/bug7287_2 index 8bbc9ba079..e637785813 100755 --- a/tests/bugs/fclasses/bug7287_2 +++ b/tests/bugs/fclasses/bug7287_2 @@ -12,13 +12,13 @@ puts "" set BugNumber OCC7287 -set NCycles 1000 +set NCycles 100 box b1 10 10 10 100 100 100 box b2 50 50 50 -bop b1 b2 set listmem {} for {set i 1} {${i} <= ${NCycles}} {incr i } { + bop b1 b2 bopcut r lappend listmem [meminfo h] if { [checktrend $listmem 0 1 "Memory leak detected"] } { diff --git a/tests/bugs/fclasses/bug7287_3 b/tests/bugs/fclasses/bug7287_3 index b529d24584..bf66c2066c 100755 --- a/tests/bugs/fclasses/bug7287_3 +++ b/tests/bugs/fclasses/bug7287_3 @@ -13,13 +13,13 @@ puts "" set BugNumber OCC7287 -set NCycles 1000 +set NCycles 100 box b1 10 10 10 100 100 100 box b2 50 50 50 -bop b1 b2 set listmem {} for {set i 1} {${i} <= ${NCycles}} {incr i } { + bop b1 b2 boptuc r lappend listmem [meminfo h] diff --git a/tests/bugs/fclasses/bug7287_4 b/tests/bugs/fclasses/bug7287_4 index 827dede2b5..427e84f298 100755 --- a/tests/bugs/fclasses/bug7287_4 +++ b/tests/bugs/fclasses/bug7287_4 @@ -12,13 +12,13 @@ puts "" set BugNumber OCC7287 -set NCycles 1000 +set NCycles 100 box b1 10 10 10 100 100 100 box b2 50 50 50 -bop b1 b2 set listmem {} for {set i 1} {${i} <= ${NCycles}} {incr i } { + bop b1 b2 bopcommon r lappend listmem [meminfo h] diff --git a/tests/bugs/fclasses/bug7287_5 b/tests/bugs/fclasses/bug7287_5 index c8ec59503a..4290eed288 100755 --- a/tests/bugs/fclasses/bug7287_5 +++ b/tests/bugs/fclasses/bug7287_5 @@ -12,12 +12,12 @@ puts "" set BugNumber OCC7287 -set NCycles 1000 +set NCycles 100 box b1 10 10 10 100 100 100 box b2 50 50 50 -bop b1 b2 for {set i 1} {${i} <= ${NCycles}} {incr i } { + bop b1 b2 bopfuse r lappend listmem [meminfo h] diff --git a/tests/bugs/fclasses/bug7287_6 b/tests/bugs/fclasses/bug7287_6 index ac32a9c39a..590285a314 100755 --- a/tests/bugs/fclasses/bug7287_6 +++ b/tests/bugs/fclasses/bug7287_6 @@ -12,12 +12,12 @@ puts "" set BugNumber OCC7287 -set NCycles 1000 +set NCycles 100 box b1 10 10 10 100 100 100 box b2 50 50 50 -bop b1 b2 for {set i 1} {${i} <= ${NCycles}} {incr i } { + bop b1 b2 bopsection r lappend listmem [meminfo h]