diff --git a/include/emp/bits/Bits_Data.hpp b/include/emp/bits/Bits_Data.hpp index e8fe4a0a03..ddb106ae25 100644 --- a/include/emp/bits/Bits_Data.hpp +++ b/include/emp/bits/Bits_Data.hpp @@ -1,7 +1,7 @@ /** * @note This file is part of Empirical, https://github.com/devosoft/Empirical * @copyright Copyright (C) Michigan State University, MIT Software license; see doc/LICENSE.md - * @date 2022. + * @date 2022-23. * * @file Bits_Data.hpp * @brief Helper class to handle memory management for Bits objects. @@ -231,9 +231,9 @@ namespace emp { { if (num_bits) bits = NewArrayPtr(NumBitFields(num_bits)); } - Bits_Data_Mem_Dynamic(const Bits_Data_Mem_Dynamic & in) : bits(nullptr) { Copy(in); } + Bits_Data_Mem_Dynamic(const Bits_Data_Mem_Dynamic & in) : base_t(), bits(nullptr) { Copy(in); } Bits_Data_Mem_Dynamic(Bits_Data_Mem_Dynamic && in) : bits(nullptr) { Move(std::move(in)); } - ~Bits_Data_Mem_Dynamic() { bits.DeleteArray(); } + ~Bits_Data_Mem_Dynamic() { if (bits) bits.DeleteArray(); } Bits_Data_Mem_Dynamic & operator=(const Bits_Data_Mem_Dynamic & in) { Copy(in); return *this; } Bits_Data_Mem_Dynamic & operator=(Bits_Data_Mem_Dynamic && in) { Move(std::move(in)); return *this; }