From: wolf Date: Fri, 4 Dec 1998 17:59:38 +0000 (+0000) Subject: Fix a stupid bug triggered by Ralf: we delete the memory of a matrix if its size... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c251f559c94cb32711475bb0e014a1653be56e18;p=dealii-svn.git 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 --- 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;