Skip to content

Commit 3d42425

Browse files
committed
Leaks in block matrices.
1 parent dd5ce20 commit 3d42425

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

plugin/mpi/PETSc-code.hpp

+9-14
Original file line numberDiff line numberDiff line change
@@ -1354,20 +1354,7 @@ namespace PETSc {
13541354
}
13551355
}
13561356
}
1357-
~initCSRfromBlockMatrix( ) {
1358-
if (e_M) {
1359-
for (int i = 0; i < N; ++i) {
1360-
delete[] e_M[i];
1361-
delete[] t_M[i];
1362-
}
1363-
delete[] e_M;
1364-
delete[] t_M;
1365-
N = 0;
1366-
M = 0;
1367-
e_M = nullptr;
1368-
t_M = nullptr;
1369-
}
1370-
}
1357+
~initCSRfromBlockMatrix( ) { }
13711358
static ArrayOfaType typeargs( ) {
13721359
return ArrayOfaType(atype< Result >( ), atype< E_Array >( ));
13731360
}
@@ -1503,6 +1490,14 @@ namespace PETSc {
15031490
MatDestroy(a + p.first * M + p.second);
15041491
sparse_mat->_exchange = reinterpret_cast<HPDDM::Subdomain<PetscScalar>**>(exchange);
15051492
delete[] a;
1493+
if (e_M) {
1494+
for (int i = 0; i < N; ++i) {
1495+
delete[] e_M[i];
1496+
delete[] t_M[i];
1497+
}
1498+
delete[] e_M;
1499+
delete[] t_M;
1500+
}
15061501
return sparse_mat;
15071502
}
15081503
};

src/bamglib/write_xdmf.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
extern long verbosity;
12
#include "write_xdmf.hpp"
23
#ifdef DEBUG
34
int debug_w = 1;

0 commit comments

Comments
 (0)