justinmfischer/SwiftlyLRU

Memory leaks

Opened this issue · 1 comments

Couple of errors in your code that result in reference cycles.

  1. Node. previous should be a weak link
  2. Remove method doesn't set node's next and previous link to nil
  3. SwiftlyLRU subscript setter should use self.queue.remove(self.queue.tail!) to drop the node

cheers
CR