krisleech/wisper — pull request #45 by kmehkeri (2014-04-14 21:53:18+00:00)
Title: Temporary global listeners are cleared after an exception was raised in block

Wisper.with_listeners(listener) leaves registrations on the thread after an exception is raised in the block. This causes subsequent messages to be handled outside the block, which is undesirable. Fortunately, the fix is easy, wrapping the block in begin ... ensure ... end, so we always call clear, whether an exception was raised or not.