Merge pull request #861 from shellhub/master

fix memory leak
This commit is contained in:
Yang Libin
2019-09-24 21:26:14 +08:00
committed by GitHub

View File

@ -61,7 +61,9 @@ public class SinglyLinkedList {
throw new RuntimeException("The list is empty!"); throw new RuntimeException("The list is empty!");
} }
Node destroy = head;
head = head.next; head = head.next;
destroy = null; // clear to let GC do its work
} }
/** /**