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

Real time client memory leaks fixes #1130

Merged
merged 12 commits into from
Jul 22, 2021
Merged

Conversation

lukasz-szyszkowski
Copy link
Contributor

This change was originally made by @mikepulaski in ably-cocoa fork (https://github.com/tupleapp/ably-cocoa/tree/gcd-leaks).

Copy link
Contributor

@QuintinWillison QuintinWillison left a comment

Choose a reason for hiding this comment

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

Looks solid. Any ideas why checks aren't passing?

@lukasz-szyszkowski
Copy link
Contributor Author

Looks solid. Any ideas why checks aren't passing?

well, it looks weird ... because sometimes they pass and sometimes not. I'll re-run all jobs an we will see if they'll pass or not

Spec/GCDTest.swift Outdated Show resolved Hide resolved
@lukasz-szyszkowski
Copy link
Contributor Author

I double-checked the failing GCD iOS test and there was an issue with this https://forums.swift.org/t/retain-count-set-to-2-and-no-deinit-called/43571/4
and finally, I changed it to this https://www.swiftbysundell.com/articles/using-unit-tests-to-identify-avoid-memory-leaks-in-swift/#closures

commit here: 0f8e29f

@maratal
Copy link
Collaborator

maratal commented Jul 4, 2021

I would mark each line with retain/release counter, such as "+1 to scheduledBlock, total = 2". Otherwise it's very frustrating to read this with a fresh eye.

why? In this solution, we don't need to check to retainCounter, this was in the previous solution and it was doubtful.

Just to give the next reader a quick idea on what's going on in this test.

@lukasz-szyszkowski
Copy link
Contributor Author

I would mark each line with retain/release counter, such as "+1 to scheduledBlock, total = 2". Otherwise it's very frustrating to read this with a fresh eye.

why? In this solution, we don't need to check to retainCounter, this was in the previous solution and it was doubtful.

Just to give the next reader a quick idea on what's going on in this test.

here 6df222c

@lukasz-szyszkowski lukasz-szyszkowski linked an issue Jul 22, 2021 that may be closed by this pull request
@lukasz-szyszkowski lukasz-szyszkowski merged commit 75c4db8 into main Jul 22, 2021
@lukasz-szyszkowski lukasz-szyszkowski deleted the fix/1129-memory-leaks branch July 22, 2021 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Memory leaks in the Realtime client
5 participants