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

Make DittoService ditto instance optional to fix retain issue #38

Closed
wants to merge 2 commits into from

Conversation

magicwave
Copy link
Contributor

DittoService strong reference to Ditto instance caused ForgeSwift library crash when reinitializing. This commit fixes the issue by making the ditto instance optional and implementing cleanup.

  • DittoService:
    • create new optional private ditto shadow property
    • expose force-unwrapped accessor of shadow property
    • implement cleanup function to set instance to nil
  • DataManager:
    • add cleanup function to ReplicatingDataInterface protocol
    • add cleanup pass-through function
  • implement cleanup pass-through functions in ChatUI, and ChatCore

DittoService strong reference to Ditto instance caused ForgeSwift library crash when
reinitializing. This commit fixes the issue by making the ditto instance optional and
implementing cleanup.

- DittoService:
    - create new optional private ditto shadow property
    - expose force-unwrapped accessor of shadow property
    - implement cleanup function to set instance to nil
- DataManager:
    - add cleanup function to ReplicatingDataInterface protocol
    - add cleanup pass-through function
- implement cleanup pass-through functions in ChatUI, and ChatCore
Copy link
Collaborator

@ErikEverson ErikEverson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be good to investigate more because if we null out DittoChat or DittoChatUI the references should go away so we should not need this to clean it up.
I will approve for now to get the fix in but I would like to reverse this when we have more time to get to the bottom of this issues

@okdistribute
Copy link

going with #40

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

Successfully merging this pull request may close these issues.

3 participants