diff options
Autocommit at 02.05.2022 @ 08:20
1 files changed, 2 insertions, 1 deletions
| -rw-r--r-- | src/List/List.cpp | 3 |
diff --git a/src/List/List.cpp b/src/List/List.cpp index 163c82a..5a0e1f2 100644 --- a/src/List/List.cpp +++ b/src/List/List.cpp @@ -65,11 +65,12 @@ template <class T> std::istream& List<T>::read(std::istream& istr) { istr.read((char*)&length, sizeof(length)); istr.read((char*)&count, sizeof(count)); + delete[] elements; elements = new T[length]; for (int i = 0; i < count; i++) - elements[i].read(istr); + elements[i].read(istr); // disgusting return istr; } |
