From c251f559c94cb32711475bb0e014a1653be56e18 Mon Sep 17 00:00:00 2001 From: wolf Date: Fri, 4 Dec 1998 17:59:38 +0000 Subject: [PATCH] Fix a stupid bug triggered by Ralf: we delete the memory of a matrix if its size is reset to zero. We check so by comparing the number of elements, which is m*n against zero. Annoyingly, m*n equals zero also, if m=n=2**16... git-svn-id: https://svn.dealii.org/trunk@682 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/source/dsmatrix.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deal.II/lac/source/dsmatrix.cc b/deal.II/lac/source/dsmatrix.cc index 7afbf58e29..89203aa238 100644 --- a/deal.II/lac/source/dsmatrix.cc +++ b/deal.II/lac/source/dsmatrix.cc @@ -68,7 +68,8 @@ dSMatrixStruct::reinit (const unsigned int m, const unsigned int n, vec_len = m * max_per_row; max_row_len = max_per_row; - if (m*n == 0) + // delete empty matrices + if ((m==0) || (n==0)) { if (rowstart) delete[] rowstart; if (colnums) delete[] colnums; -- 2.39.5