From 731a2fa45317ee51aa9dc6f4cc16b512fc2757ca Mon Sep 17 00:00:00 2001 From: Pierre Marchand Date: Mon, 29 Jan 2024 19:31:33 +0100 Subject: [PATCH] fixup --- include/htool/basic_types/matrix.hpp | 3 ++- include/htool/solvers/ddm.hpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/htool/basic_types/matrix.hpp b/include/htool/basic_types/matrix.hpp index b9227085..4ba2d817 100644 --- a/include/htool/basic_types/matrix.hpp +++ b/include/htool/basic_types/matrix.hpp @@ -209,8 +209,9 @@ class Matrix { the number of columns is set to _nbc_. */ void resize(const int nbr, const int nbc, T value = 0) { - if (m_is_owning_data) { + if (m_data != nullptr and m_is_owning_data) { delete[] m_data; + m_data = nullptr; } m_data = new T[nbr * nbc]; m_number_of_rows = nbr; diff --git a/include/htool/solvers/ddm.hpp b/include/htool/solvers/ddm.hpp index ebdf0881..997c3e56 100644 --- a/include/htool/solvers/ddm.hpp +++ b/include/htool/solvers/ddm.hpp @@ -128,7 +128,7 @@ class DDM { mytime[1] = MPI_Wtime() - time; time = MPI_Wtime(); - hpddm_op->buildTwo(MPI_COMM_WORLD, coarse_operator.release()); + hpddm_op->buildTwo(MPI_COMM_WORLD, coarse_operator.data()); mytime[2] = MPI_Wtime() - time; // Timing