oalders/html-restrict — pull request #15 by bleargh45 (2013-04-25 16:58:07+00:00)
Title: Use a weak reference to HTML::Parser, eliminating circular ref.

When the HTML::Parser object is created in "_build_parser", it holds a
reference to "$self" (the HTML::Restrict object) in the closures used to
do the parsing. That creates a circular reference between the HTML::Parser
object and the HTML::Restrict object, which then causes us to leak
memory every time we're used (as neither of the objects will ever get
freed).

So, weaken our handle to the HTML::Parser object, breaking the circular
reference.