author | Kris Maglione <maglione.k@gmail.com> |
Thu, 27 Apr 2017 21:15:09 -0700 | |
changeset 570372 | 1d04e935773ada5045798a31194de3a5767279a6 |
parent 570371 | 12abb113b05de62352182de4b377e521d183a77a |
child 570373 | c870ccf566f3b57e672ab15ce6203c280db310f3 |
push id | 56465 |
push user | maglione.k@gmail.com |
push date | Fri, 28 Apr 2017 19:36:32 +0000 |
reviewers | waldo |
bugs | 1359653 |
milestone | 55.0a1 |
mfbt/LinkedList.h | file | annotate | diff | comparison | revisions |
--- a/mfbt/LinkedList.h +++ b/mfbt/LinkedList.h @@ -643,16 +643,21 @@ private: }; template <typename T> class AutoCleanLinkedList : public LinkedList<T> { public: ~AutoCleanLinkedList() { + Clear(); + } + + void Clear() + { while (T* element = this->popFirst()) { delete element; } } }; } /* namespace mozilla */