Skip to content

Fix media span and task list memory leaks - #1088

Merged
khaykov merged 4 commits into
trunkfrom
issue/fix-media-span-and-task-list-memory-leaks
Jul 25, 2024
Merged

Fix media span and task list memory leaks#1088
khaykov merged 4 commits into
trunkfrom
issue/fix-media-span-and-task-list-memory-leaks

Conversation

@khaykov

@khaykovkhaykov commented Jul 25, 2024

Copy link
Copy Markdown
Contributor

Fix

This PR fixes memory leaks in media and task list spans.

Test

  1. Toggle items in task list, make sure they work as expected.
  2. Delete images, confirm that you see a "media deleted" snackbar.
  3. Perform same actions after changing device orientation or bringing up to foreground from background.

@zwarmzwarm self-assigned this Jul 25, 2024

@zwarmzwarm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@khaykov - Tested and all works as expected. 👍

I have one question: Might it be safer to use
val drawable = contextRef.get()?.resources?.getDrawable(R.drawable.ic_checkbox, null)

instead of

val d: Drawable = contextRef.get()!!.resources.getDrawable(R.drawable.ic_checkbox, null)

I am approving the PR, but will leave the merge for you so you'll have a chance to review my question.

@khaykov

Copy link
Copy Markdown
ContributorAuthor

@zwarm Good point! Switched to elvis operator 👍

@khaykov
khaykov merged commit 2d66175 into trunkJul 25, 2024
@khaykov
khaykov deleted the issue/fix-media-span-and-task-list-memory-leaks branch July 25, 2024 21:42
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@khaykov@zwarm