seivan/SHKeyValueObserverBlocks — pull request #5 by th-in-gs (2013-09-10 11:56:51+00:00)
Title: Test for infinite loop when deallocating

Test for infinite loop when deallocating a class hierarchy in which the subclass and superclass deallocs have been swizzled independently.

As I understand it, the problem is that when a superclass and a subclass have both _independently_ had `-dealloc` rewritten:

1) The `-dealloc` in the subclass fires
2) The overridden `-dealloc` calls `-uniqueSelector`
3) `-uniqueSelector` (the old subclass' `-dealloc`) calls `[super dealloc]` internally.
4) This calls the superclass' overridden `-dealloc`, which calls `[self uniqueSelector]`
5) The ObjC runtime looks up uniqueSelector on self, and so the _subclass_' overridden `-uniqueSelector` is called again, taking us back to (3).

Again, I know about this because I did the same thing at first :-)