specta/expecta — pull request #39 by jspahrsummers (2013-07-25 05:52:43+00:00)
Title: Fix EXC_BAD_ACCESS from copying block after the matcher is freed

After updating to 0.2.2, I ran into some `EXC_BAD_ACCESS` errors in [-applyMatcher:to:](https://github.com/specta/expecta/blob/c57bd8b9cafe3b3614ce1b9fc35693b46eae3588/src/EXPExpect.m#L95-L96). My theory was that the matcher got prematurely freed somewhere.

Within `_EXPMatcherImplementationEnd`, the matcher is freed before the block retains it (since blocks only retain captured objects when copied). Moving the copy earlier than the release seems to fix the issue I ran into.