-
Notifications
You must be signed in to change notification settings - Fork 331
Description
When SEGAnalytics
is initialized, it creates and strongly retains a SEGIntegrationsManager
, passing self
to SEGIntegrationsManager
's initializer, which then retains it strongly, thus creating a retain cycle.
This becomes an issue for our project as we sometimes switch environment and they have different keys so we have to re-create SEGAnalytics
. When we do this the old one still sticks around and we then start to send multiple events for application events as the old SEGAnalytics
is still getting notifications from the notification center.
Relevant declarations:
https://github.com/segmentio/analytics-ios/blob/master/Segment/Classes/SEGAnalytics.m#L28
https://github.com/segmentio/analytics-ios/blob/master/Segment/Internal/SEGIntegrationsManager.m#L67
Oh, the irony: https://github.com/segmentio/analytics-ios/blob/master/Segment/Classes/SEGAnalytics.m#L53