jdg/MBProgressHUD — pull request #52 by pereckerdal (2012-03-14 09:16:27+00:00)
Title: Crash when initing MBProgressHUD object with initWithView and then not adding it to a superview

The `initWithView` method registers the `MBProgressHUD` object as an observer in `NSNotificationCenter`. There is a corresponding `removeObserver` call in `removeFromSuperview`, but that method is not called unless you actually add the `MBProgressHUD` object to some view.

This results in spurious app crashes and possibly memory corruption, primarily when the app enters foreground after having been in the background.

This patch adds a call to `removeObserver` to `dealloc`, which is to me seems to be the most logical, safe and symmetrical place to do it.

(I'm sorry about the messy commit layout. The diff is clean though.)