bitstadium/HockeySDK-iOS — pull request #64 by idpaterson (2013-09-27 17:47:21+00:00)
Title: NSNotificationCenter notifications were not being cleaned up properly

There are a few dangling `NSNotificationCenter` observers that are not cleaned up at deallocation. This caused our app to crash based on our setup where the user has to select an option in the app settings to enable private builds (we don't want our clients to see a HockeyApp popup when the app launches so we provide the separate option for QA). That implementation involves calling `[[BITHockeyManager sharedManager] startManager];` when they toggle the switch.

The pull request is the minimal required to fix the problem. I highly recommend rejecting the pull request and instead using `[[NSNotificationCenter defaultCenter] removeObserver:self];` upon deallocation to ensure that all observers are removed. There are a number of inconsistencies in whether `-dealloc` calls a different method to unregister notifications or performs the removal itself, and my 2¢ is that it seems less problematic moving forward to remove all observers on dealloc in one fell swoop than pairing with each that was registered.