You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
When
SEGAnalytics
is initialized, it creates and strongly retains aSEGIntegrationsManager
, passingself
toSEGIntegrationsManager
'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 oldSEGAnalytics
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
The text was updated successfully, but these errors were encountered: