Itseez/opencv — pull request #2856 by sanchom (2014-06-12 18:14:57+00:00)
Title: Bugfix: Memory leak in deletion of er_stack nodes of ERFilter.

In ERFilterNM::er_tree_extract, clean-up of the er_stack vector was only deleting its elements, which are actually roots of tree structures. This was leaking memory. Proper clean-up involves traversal and deletion of the entire tree that is rooted at each element of er_stack.