From 030348a284415e04315b4ee865da47d7bce74fdd Mon Sep 17 00:00:00 2001 From: liushubin-gitHub <65377959+liushubin-gitHub@users.noreply.github.com> Date: Wed, 27 May 2020 10:03:54 +0800 Subject: [PATCH] Update doubly_linked_list.cpp when remove an item , should free the item memory --- data_structure/doubly_linked_list.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/data_structure/doubly_linked_list.cpp b/data_structure/doubly_linked_list.cpp index 17ea2983a..4fc38abfc 100644 --- a/data_structure/doubly_linked_list.cpp +++ b/data_structure/doubly_linked_list.cpp @@ -61,6 +61,7 @@ void double_linked_list::remove(int x) { t->prev->next = t->next; t->next->prev = t->prev; } + delete t; } void double_linked_list::search(int x) {