Skip to content

Fix memory leak in EnhancedMovementMethod - #1086

Merged
zwarm merged 4 commits into
trunkfrom
issue/fix-memory-leak-in-enhanced-movement-method
Jul 22, 2024
Merged

Fix memory leak in EnhancedMovementMethod#1086
zwarm merged 4 commits into
trunkfrom
issue/fix-memory-leak-in-enhanced-movement-method

Conversation

@khaykov

@khaykovkhaykov commented Jul 18, 2024

Copy link
Copy Markdown
Contributor

Fix

With a help from Leak Canary I found a leak in EnhancedMovementMethod.

In this PR we are using weak reference for a click listener. Task list listener is not leaking, so it's ok to keep it as is.

Test

  1. Add link tap handler to aztec instance in Main Activity like this:
 aztec = Aztec.with(visualEditor, sourceEditor, toolbar, this)
....
.setLinkTapEnabled(true)
.setOnLinkTappedListener(object : AztecText.OnLinkTappedListener {
override fun onLinkTapped(widget: View, url: String) {
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
startActivity(intent)
}
})
....
  1. Open the app in tap on the link.
  2. Confirm that it works and the browser is opened.

Review

@[USER_NAME]

Make sure strings will be translated:

  • If there are new strings that have to be translated, I have added them to the client's strings.xml as a part of the integration PR.

@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.

All looks good @khaykov
I was able to tap on a link and launch the browser. 🥳

@zwarm
zwarm merged commit 3c95e7b into trunkJul 22, 2024
@zwarm
zwarm deleted the issue/fix-memory-leak-in-enhanced-movement-method branch July 22, 2024 21:07
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