From: Wolfgang Bangerth Date: Sun, 1 Mar 2015 19:07:37 +0000 (-0600) Subject: Fix another occurrence of allocate() in the serialization load function. X-Git-Tag: v8.3.0-rc1~401^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F624%2Fhead;p=dealii.git Fix another occurrence of allocate() in the serialization load function. This also uncovers a memory leak we had. --- diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index 1a08867d98..a44067ba2e 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -1347,12 +1347,14 @@ inline void Vector::load (Archive &ar, const unsigned int) { - // forward to serialization function in the base class. - ar &static_cast(*this); + // get rid of previous content + deallocate(); + // the load stuff again from the archive + ar &static_cast(*this); ar &vec_size &max_vec_size ; - allocate(max_vec_size); + allocate(); ar &boost::serialization::make_array(val, max_vec_size); }