From fefb3b743b4f61fce3db8d15ecff0ab31514e12d Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 2 May 2022 08:20:18 +0300 Subject: Autocommit at 02.05.2022 @ 08:20 --- src/List/List.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/List/List.cpp') 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 std::istream& List::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; } -- cgit v1.3.1-23-gd82d