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

UIKitView. Fix lifetime discrepancy within the composition. #576

Merged
merged 2 commits into from
Jun 8, 2023

Conversation

elijah-semyonov
Copy link

Proposed Changes

  • Remember the factory invocation result.
  • Add indirection to retrieve latest onValueChanged lambda.
  • Remove parameters on DisposableEffect, since relevant UIView lifetime is already bound to composable function lifetime.
  • Remove redundant target removal logic passed as onRelease lambda, addTarget doesn't retain target.

Testing

Test: launch a repro from issued mentioned below

Issues Fixed

Fixes: Bug on JetBrains/compose-multiplatform#3119.

To clarify

Do we need to remember onRelease?

@elijah-semyonov elijah-semyonov self-assigned this May 22, 2023
@elijah-semyonov elijah-semyonov changed the title Apply a fix Fix UIView lifetime discrepancy within the composition. May 22, 2023
@elijah-semyonov elijah-semyonov requested review from mazunin-v-jb and removed request for dima-avdeev-jb May 30, 2023 15:53
Copy link
Member

@MatkovIvan MatkovIvan left a comment

Choose a reason for hiding this comment

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

Do we still have no unit tests setup for this part?

@elijah-semyonov elijah-semyonov merged commit 47c012b into jb-main Jun 8, 2023
@elijah-semyonov elijah-semyonov deleted the elijah.semyonov/uiview-disappearing-fix branch June 8, 2023 08:20
igordmn pushed a commit that referenced this pull request Jul 10, 2023
Test: ./gradlew test connectedCheck
Bug: 270612487

This is an imported pull request from androidx#576.

Resolves #576
Github-Pr-Head-Sha: 2a52799
GitOrigin-RevId: 0cb474a

Change-Id: I8bdb3a7b0a53cc47e20e1fecf8e4c3de78819bae
@igordmn igordmn changed the title Fix UIView lifetime discrepancy within the composition. ComposeUITextField. Fix lifetime discrepancy within the composition. Jul 25, 2023
@igordmn igordmn changed the title ComposeUITextField. Fix lifetime discrepancy within the composition. UIKitView. Fix lifetime discrepancy within the composition. Jul 25, 2023
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