Skip to content

Commit ea10681

Browse files
authored
Merge pull request #32 from petrobras/develop
Fix Windows access violation during Marlim3 cleanup and update version
2 parents b103931 + 32b9822 commit ea10681

9 files changed

Lines changed: 56 additions & 60 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ celerybeat-schedule
8484
.spyderproject
8585
.spyproject
8686
.ropeproject
87+
marlim-batch-mr2/
8788

8889
# Logs, temporarios e backup
8990
*.log

_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Version information for Marlim3 package."""
22

3-
__version__ = '3.6.3'
3+
__version__ = '3.6.4'

src/core/Leitura.cpp

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,16 +1100,15 @@ Ler& Ler::operator =(const Ler& vler) {
11001100
delete [] Tempsonico;
11011101
}
11021102

1103-
if(nfluP>0){
1103+
if(tabVisc!=0){
11041104
for(int i=0; i<nfluP;i++){
1105-
if(flup[i].corrOM==7){
1106-
if(tabVisc[i].parserie>0){
1107-
delete [] tabVisc[i].visc;
1108-
delete [] tabVisc[i].temp;
1109-
}
1110-
delete [] tabVisc;
1105+
if(tabVisc[i].parserie>0){
1106+
delete [] tabVisc[i].visc;
1107+
delete [] tabVisc[i].temp;
11111108
}
11121109
}
1110+
delete [] tabVisc;
1111+
tabVisc=0;
11131112
}
11141113

11151114
if(nsegrega>0){
@@ -1627,16 +1626,15 @@ void Ler::copiaSemJson(Ler& vler) {
16271626
delete [] Tempsonico;
16281627
}
16291628

1630-
if(nfluP>0){
1629+
if(tabVisc!=0){
16311630
for(int i=0; i<nfluP;i++){
1632-
if(flup[i].corrOM==7){
1633-
if(tabVisc[i].parserie>0){
1634-
delete [] tabVisc[i].visc;
1635-
delete [] tabVisc[i].temp;
1636-
}
1637-
delete [] tabVisc;
1631+
if(tabVisc[i].parserie>0){
1632+
delete [] tabVisc[i].visc;
1633+
delete [] tabVisc[i].temp;
16381634
}
16391635
}
1636+
delete [] tabVisc;
1637+
tabVisc=0;
16401638
}
16411639

16421640
if(nsegrega>0){
@@ -5273,9 +5271,9 @@ void Ler::parse_fluidos_producao(
52735271
&iier);
52745272
for(int k=0;k<npseudo;k++)flup[i].fracMol[k]=oGORAdjustedGlobalComp[k];
52755273
flup[i].atualizaPropCompStandard();
5276-
delete GivenInitialLiqComposition;
5277-
delete GivenInitialVapComposition;
5278-
delete oGORAdjustedGlobalComp;
5274+
delete[] GivenInitialLiqComposition;
5275+
delete[] GivenInitialVapComposition;
5276+
delete[] oGORAdjustedGlobalComp;
52795277
}
52805278
}
52815279

src/core/LerAS.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3357,9 +3357,9 @@ void ASens::atualizaCompRGO(double rgo, ProFlu& flui){
33573357
&iier);
33583358
for(int k=0;k<npseudo;k++)flui.fracMol[k]=oGORAdjustedGlobalComp[k];
33593359
flui.atualizaPropCompStandard();
3360-
delete GivenInitialLiqComposition;
3361-
delete GivenInitialVapComposition;
3362-
delete oGORAdjustedGlobalComp;
3360+
delete[] GivenInitialLiqComposition;
3361+
delete[] GivenInitialVapComposition;
3362+
delete[] oGORAdjustedGlobalComp;
33633363

33643364
}
33653365

src/core/PropFlu.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,9 +1829,9 @@ ProFlu& ProFlu::operator =(const ProFlu& fluido){//alteracao2
18291829
}
18301830

18311831
if(flashCompleto==2 || fluido.npseudo>0){
1832-
if(npseudo>0)delete fracMol;
1833-
if(npseudo>0)delete oCalculatedLiqComposition;
1834-
if(npseudo>0)delete oCalculatedVapComposition;
1832+
if(npseudo>0)delete[] fracMol;
1833+
if(npseudo>0)delete[] oCalculatedLiqComposition;
1834+
if(npseudo>0)delete[] oCalculatedVapComposition;
18351835
npseudo=fluido.npseudo;
18361836
fracMol=new double[npseudo];
18371837
oCalculatedLiqComposition=new double[npseudo];
@@ -6688,4 +6688,3 @@ ostream& operator<<(ostream& s, const ProFlu& flui){
66886688
}
66896689

66906690
//template class ProFlu;
6691-

src/core/SisProd.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2618,7 +2618,7 @@ void SProd::montasistema(double* compfonte,int* posicfonte, int nfontes) {
26182618

26192619
resettrendtrans[i] = 0;
26202620
ntrendtrans[i] = 0;
2621-
ntrendtransB = new int[arq.ntendtransp];
2621+
ntrendtransB[i] = 0;
26222622
}
26232623

26242624
}
@@ -34722,4 +34722,3 @@ double SProd::buscaTramoSecVazPerm(double pPartida, int indPartida) {
3472234722
}
3472334723

3472434724
//template class SProd;
34725-

src/include/Leitura.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2019,13 +2019,11 @@ class Ler{
20192019
delete [] Tempsonico;
20202020
}
20212021

2022-
if(nfluP>0){
2022+
if(tabVisc!=0){
20232023
for(int i=0; i<nfluP;i++){
2024-
if(flup[i].corrOM==7){
2025-
if(tabVisc[i].parserie>0){
2026-
delete [] tabVisc[i].visc;
2027-
delete [] tabVisc[i].temp;
2028-
}
2024+
if(tabVisc[i].parserie>0){
2025+
delete [] tabVisc[i].visc;
2026+
delete [] tabVisc[i].temp;
20292027
}
20302028
}
20312029
delete [] tabVisc;

src/include/PropFlu.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -769,8 +769,8 @@ class ProFlu{
769769
RGO=tempRGO;
770770
if(dStockTankVaporMassFraction>0 && RGO<1e-15)RGO=1e6;
771771
IRGO=RGO*35.31467/6.29;
772-
if(nuloL==1)delete GivenInitialLiqComposition;
773-
if(nuloV==1)delete GivenInitialVapComposition;
772+
if(nuloL==1)delete[] GivenInitialLiqComposition;
773+
if(nuloV==1)delete[] GivenInitialVapComposition;
774774
}
775775

776776
void atualizaPropComp(double pres, double temp,double GivenInitialBeta=-1.0,
@@ -846,8 +846,8 @@ class ProFlu{
846846

847847
}
848848
}
849-
if(nuloL==1)delete GivenInitialLiqComposition;
850-
if(nuloV==1)delete GivenInitialVapComposition;
849+
if(nuloL==1)delete[] GivenInitialLiqComposition;
850+
if(nuloV==1)delete[] GivenInitialVapComposition;
851851

852852
}
853853

@@ -877,4 +877,3 @@ ostream& operator<<(ostream& s, const ProFlu&);//saida de valores de propriedade
877877

878878

879879
#endif
880-

src/include/SisProd.h

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -629,11 +629,12 @@ class SProd {
629629
if(arq.nperfistransg>0 && arq.lingas>0) delete [] ncelperftransg;
630630

631631
if(arq.ntendp>0 && redeTemporario==0) {
632-
for(int i=0;i<arq.ntendp;i++) {
633-
for(int j=0; j<TrendLengthP[i]; j++) //if(MatTrendP[i][j]) delete [] MatTrendP[i][j];
634-
if(MatTrendP)delete [] MatTrendP[i][j];
635-
//if(MatTrendP[i])delete [] MatTrendP[i];
636-
if(MatTrendP)delete [] MatTrendP[i];
632+
for(int i=0;i<arq.ntendp && MatTrendP && TrendLengthP;i++) {
633+
if(MatTrendP[i]) {
634+
for(int j=0; j<TrendLengthP[i]; j++)
635+
delete [] MatTrendP[i][j];
636+
delete [] MatTrendP[i];
637+
}
637638
}
638639
//if(MatTrendP)delete [] MatTrendP;
639640
if(MatTrendP)delete [] MatTrendP;
@@ -647,11 +648,12 @@ class SProd {
647648
}
648649

649650
if(arq.ntendg>0 && arq.lingas>0 && redeTemporario==0) {
650-
for(int i=0;i<arq.ntendg;i++) {
651-
for(int j=0; j<TrendLengthG[i]; j++) //if(MatTrendG[i][j]) delete [] MatTrendG[i][j];
652-
if(MatTrendG)delete [] MatTrendG[i][j];
653-
//if(MatTrendG[i])delete [] MatTrendG[i];
654-
if(MatTrendG)delete [] MatTrendG[i];
651+
for(int i=0;i<arq.ntendg && MatTrendG && TrendLengthG;i++) {
652+
if(MatTrendG[i]) {
653+
for(int j=0; j<TrendLengthG[i]; j++)
654+
delete [] MatTrendG[i][j];
655+
delete [] MatTrendG[i];
656+
}
655657
}
656658
//if(MatTrendG)delete [] MatTrendG;
657659
if(MatTrendG)delete [] MatTrendG;
@@ -664,12 +666,12 @@ class SProd {
664666
if(ntrendgB)delete [] ntrendgB;
665667
}
666668
if(arq.ntendtransp>0 && redeTemporario==0) {
667-
for(int i=0;i<arq.ntendtransp;i++) {
668-
for(int j=0; j<TrendLengthTransP[i]; j++)
669-
//if(MatTrendTransP[i][j]) delete [] MatTrendTransP[i][j];
670-
//if(MatTrendTransP[i])delete [] MatTrendTransP[i];
671-
if(MatTrendTransP)delete [] MatTrendTransP[i][j];
672-
if(MatTrendTransP)delete [] MatTrendTransP[i];
669+
for(int i=0;i<arq.ntendtransp && MatTrendTransP && TrendLengthTransP;i++) {
670+
if(MatTrendTransP[i]) {
671+
for(int j=0; j<TrendLengthTransP[i]; j++)
672+
delete [] MatTrendTransP[i][j];
673+
delete [] MatTrendTransP[i];
674+
}
673675
}
674676
//if(MatTrendTransP)delete [] MatTrendTransP;
675677
if(MatTrendTransP)delete [] MatTrendTransP;
@@ -683,12 +685,12 @@ class SProd {
683685
}
684686

685687
if(arq.ntendtransg>0 && redeTemporario==0) {
686-
for(int i=0;i<arq.ntendtransg;i++) {
687-
for(int j=0; j<TrendLengthTransG[i]; j++)
688-
//if(MatTrendTransP[i][j]) delete [] MatTrendTransP[i][j];
689-
//if(MatTrendTransP[i])delete [] MatTrendTransP[i];
690-
if(MatTrendTransG)delete [] MatTrendTransG[i][j];
691-
if(MatTrendTransG)delete [] MatTrendTransG[i];
688+
for(int i=0;i<arq.ntendtransg && MatTrendTransG && TrendLengthTransG;i++) {
689+
if(MatTrendTransG[i]) {
690+
for(int j=0; j<TrendLengthTransG[i]; j++)
691+
delete [] MatTrendTransG[i][j];
692+
delete [] MatTrendTransG[i];
693+
}
692694
}
693695
//if(MatTrendTransP)delete [] MatTrendTransP;
694696
if(MatTrendTransG)delete [] MatTrendTransG;

0 commit comments

Comments
 (0)