mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0022936: Memory leak in inc\MAT_Mat.gxx line
This commit is contained in:
@@ -146,14 +146,9 @@ void MAT_Mat::CreateMat(Tool& atool)
|
|||||||
toleranceofconfusion = atool.ToleranceOfConfusion();
|
toleranceofconfusion = atool.ToleranceOfConfusion();
|
||||||
NumberMaxOfIte = noofedges*noofedges;
|
NumberMaxOfIte = noofedges*noofedges;
|
||||||
|
|
||||||
Standard_Integer* firstarea = new Standard_Integer[noofedges];
|
TColStd_Array1OfInteger firstarea(0, noofedges);
|
||||||
Standard_Integer* lastarea = new Standard_Integer[noofedges];
|
TColStd_Array1OfInteger lastarea(0, noofedges);
|
||||||
Standard_Integer* noofarea = new Standard_Integer[noofedges];
|
TColStd_Array1OfInteger noofarea(0, noofedges);
|
||||||
|
|
||||||
if (noofarea == 0) {
|
|
||||||
cout <<" Erreur d allocation "<<endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer parama[2];
|
Standard_Integer parama[2];
|
||||||
Standard_Integer paramb[2];
|
Standard_Integer paramb[2];
|
||||||
@@ -519,19 +514,19 @@ void MAT_Mat::CreateMat(Tool& atool)
|
|||||||
cout <<" A ELIMINER "<<endl;
|
cout <<" A ELIMINER "<<endl;
|
||||||
#endif
|
#endif
|
||||||
if(narea < 0) {
|
if(narea < 0) {
|
||||||
firstarea[++narea] = theedgelist->Index();
|
firstarea(++narea) = theedgelist->Index();
|
||||||
lastarea[narea] = firstarea[narea];
|
lastarea(narea) = firstarea(narea);
|
||||||
noofarea[narea] = 1;
|
noofarea(narea) = 1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(theedgelist->Index() == lastarea[narea]+1) {
|
if(theedgelist->Index() == lastarea(narea)+1) {
|
||||||
lastarea[narea]++;
|
lastarea(narea)++;
|
||||||
noofarea[narea]++;
|
noofarea(narea)++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
firstarea[++narea] = theedgelist->Index();
|
firstarea(++narea) = theedgelist->Index();
|
||||||
lastarea[narea] = firstarea[narea];
|
lastarea(narea) = firstarea(narea);
|
||||||
noofarea[narea] = 1;
|
noofarea(narea) = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -543,10 +538,10 @@ void MAT_Mat::CreateMat(Tool& atool)
|
|||||||
|
|
||||||
compact = 0;
|
compact = 0;
|
||||||
if(narea > 0) {
|
if(narea > 0) {
|
||||||
if(lastarea[narea] == theedgelist->Number() && firstarea[0] == 1) {
|
if(lastarea(narea) == theedgelist->Number() && firstarea(0) == 1) {
|
||||||
firstarea[0] = firstarea[narea];
|
firstarea(0) = firstarea(narea);
|
||||||
noofarea[0] = noofarea[0]+noofarea[narea];
|
noofarea(0) = noofarea(0)+noofarea(narea);
|
||||||
compact = noofarea[narea];
|
compact = noofarea(narea);
|
||||||
narea--;
|
narea--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -572,12 +567,12 @@ void MAT_Mat::CreateMat(Tool& atool)
|
|||||||
beginbisector = noofbisectors;
|
beginbisector = noofbisectors;
|
||||||
shift = 0;
|
shift = 0;
|
||||||
all = 0;
|
all = 0;
|
||||||
if(narea == 1 && noofarea[0] == theedgelist->Number()) all = 1;
|
if(narea == 1 && noofarea(0) == theedgelist->Number()) all = 1;
|
||||||
|
|
||||||
for(i=0; i<narea; i++) {
|
for(i=0; i<narea; i++) {
|
||||||
if(i == 1)shift = shift-compact;
|
if(i == 1)shift = shift-compact;
|
||||||
theedgelist->First();
|
theedgelist->First();
|
||||||
edgetoremove = theedgelist->Brackets(firstarea[i]-shift);
|
edgetoremove = theedgelist->Brackets(firstarea(i)-shift);
|
||||||
|
|
||||||
edgetoremove->FirstBisector()->EndPoint(edgetoremove
|
edgetoremove->FirstBisector()->EndPoint(edgetoremove
|
||||||
->IntersectionPoint());
|
->IntersectionPoint());
|
||||||
@@ -605,7 +600,7 @@ void MAT_Mat::CreateMat(Tool& atool)
|
|||||||
bisectormap(noofbisectors)->AddBisector(edgetoremove
|
bisectormap(noofbisectors)->AddBisector(edgetoremove
|
||||||
->FirstBisector());
|
->FirstBisector());
|
||||||
|
|
||||||
for(j=0; j<noofarea[i]; j++) {
|
for(j=0; j<noofarea(i); j++) {
|
||||||
theedgelist->Unlink();
|
theedgelist->Unlink();
|
||||||
theedgelist->Next();
|
theedgelist->Next();
|
||||||
shift++;
|
shift++;
|
||||||
@@ -614,7 +609,7 @@ void MAT_Mat::CreateMat(Tool& atool)
|
|||||||
cout<<" Suppression de l'arete : "<<edgetoremove->EdgeNumber()<<endl;
|
cout<<" Suppression de l'arete : "<<edgetoremove->EdgeNumber()<<endl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(all == 0 || j+1 != noofarea[i]) {
|
if(all == 0 || j+1 != noofarea(i)) {
|
||||||
bisectormap(noofbisectors)->AddBisector(edgetoremove
|
bisectormap(noofbisectors)->AddBisector(edgetoremove
|
||||||
->SecondBisector());
|
->SecondBisector());
|
||||||
}
|
}
|
||||||
@@ -764,12 +759,6 @@ void MAT_Mat::CreateMat(Tool& atool)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------
|
|
||||||
// Destruction des tableaux dynamiques.
|
|
||||||
//-------------------------------------
|
|
||||||
delete [] firstarea;
|
|
||||||
delete [] lastarea ;
|
|
||||||
delete [] noofarea ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
|
Reference in New Issue
Block a user