Add a pop method and deallocate list elements in destroy().