rjbs/Throwable — pull request #9 by haarg (2014-03-07 00:33:18+00:00)
Title: Fix leak

Throwable objects leak memory if you don't examine their stack trace. This fixes it by having the stack trace builder inlined into the constructor, so that the Throwable object itself never appears in the stack trace.

The leak test wasn't working, although I'm not sure why. Removing the extra check fixes it though.

An alternate approach to fixing this would be if Devel::StackTrace provided a way to filter the stack frames it captures immediately on construction, instead of only filtering them when the frames are examined.