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

Fix retain cycle in MXKRoomDataSource #5923

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

Johennes
Copy link
Contributor

@Johennes Johennes commented Mar 27, 2022

This is the first part of a fix for a triple-leak involving MXKRoomDataSource, MXRoomEventTimeline and MXEventListener. The second part can be found in matrix-org/matrix-ios-sdk#1424.

The concrete issue here is that MXKRoomDataSource stores an event listener in a strong property but captures self in the listener's onEvent block.

I haven't found concrete steps to reproduce the leak (and the memory graph debugger is also not 100% reliable) but the cycle frequently shows after having entered, left and posted in rooms a few times.

Screenshot 2022-03-27 at 20 31 21

Relates to: #5058

Pull Request Checklist

  • I read the contributing guide
  • UI change has been tested on both light and dark themes, in portrait and landscape orientations and on iPhone and iPad simulators
  • Accessibility has been taken into account.
  • Pull request is based on the develop branch
  • Pull request contains a changelog file in ./changelog.d
  • You've made a self review of your PR
  • Pull request includes screenshots or videos of UI changes
  • Pull request includes a sign off

Relates to: #5058
Signed-off-by: Johannes Marbach <[email protected]>
@github-actions
Copy link

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/Qen1mY

@pixlwave pixlwave requested review from a team and pixlwave and removed request for a team March 29, 2022 10:10
Copy link
Member

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

Thanks @Johennes, these changes make sense to me 👍

@pixlwave pixlwave merged commit 1a77067 into develop Mar 29, 2022
@pixlwave pixlwave deleted the johannes/5058_room_data_source_leak branch March 29, 2022 11:10
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.

2 participants