Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a plugin to Analytics causes a circular reference #326

Closed
kmpa opened this issue Apr 16, 2024 · 6 comments
Closed

Adding a plugin to Analytics causes a circular reference #326

kmpa opened this issue Apr 16, 2024 · 6 comments
Assignees
Labels

Comments

@kmpa
Copy link

kmpa commented Apr 16, 2024

It seems that when an Amplitude plugin is added to Analytics using .add(plugin:) method it will cause a circular reference to Analytics.

This becomes a problem in our application as we need to be able free all services that are used in the application. Now because of the circular reference the application will crash, starting from the version 1.5.3 onwards. This version introduced a check in Analytics init method for multiple instances having the same write key.

In case no plugins are added there is no circular reference and Analytics can be freed normally.

Operating system: iOS
Reproduced: Every time

@bsneed
Copy link
Contributor

bsneed commented Apr 18, 2024

Looks like an issue with the amplitude plugin not marking the analytics var as weak. Will address it over there. Thanks for finding that @kmpa!

@bsneed
Copy link
Contributor

bsneed commented Apr 18, 2024

@bsneed bsneed closed this as completed Apr 18, 2024
@sergiymomot
Copy link

@bsneed
Copy link
Contributor

bsneed commented May 14, 2024

Thanks @sergiymomot ! I'll go get that one updated.

@bsneed
Copy link
Contributor

bsneed commented May 14, 2024

done!

@sergiymomot
Copy link

@bsneed thanks for the quick fix 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants