From 3917622aa5915e29efd0da837967fae63e2e7adc Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Mon, 14 Jul 2014 18:13:04 +0200 Subject: [PATCH] Remove KVO observer on dealloc This case should never happen, since the SDK is supposed to be used via the sharedInstance and never be deallocated. --- Classes/BITHockeyManager.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Classes/BITHockeyManager.m b/Classes/BITHockeyManager.m index 5cd2b8c874..802deaa9a2 100644 --- a/Classes/BITHockeyManager.m +++ b/Classes/BITHockeyManager.m @@ -162,6 +162,15 @@ bitstadium_info_t bitstadium_library_info __attribute__((section("__TEXT,__bit_h return self; } +- (void)dealloc { +#if HOCKEYSDK_FEATURE_AUTHENTICATOR + // start Authenticator + if (![self isAppStoreEnvironment]) { + [_authenticator removeObserver:self forKeyPath:@"identified"]; + } +#endif +} + #pragma mark - Public Instance Methods (Configuration)