pandamonia/BlocksKit — pull request #98 by blakewatters (2012-10-11 16:04:33+00:00)
Title: Fix crash during `removeAllBlockObservers` 

This pull request fixes a crash that occurs when one invokes `removeAllBlockObservers` for an object that has had multiple key path observers registered via the `addObserverForKeyPaths:` family of methods.

The issue is that when the removal retrieves the observation dictionary from the associated object, the same trampoline object appears multiple times within the values of the observation dictionary. The code then iterates over each trampoline object attempting to tear down each observed key path. The first iteration succeeds and then the second iteration crashes as the key path is no longer being observed. The patch collects all the trampoline objects into a set to unique them before iteration.