Skip to content

Nimbus: remove Disposable-related code - #7684

Open
bendk wants to merge 1 commit into
mozilla:mainfrom
bendk:bdk/push-qymrtzrqlnkl
Open

bendk wants to merge 1 commit into
mozilla:mainfrom
bendk:bdk/push-qymrtzrqlnkl

Conversation

@bendk

@bendk bendk commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

This code comes from the UniFFI Kotlin bindings, but it's not needed anymore. Nowadays, UniFFI frees object references when the Kotlin object is destroyed. The only reason to manually destroy an object is if it holds a resource that you want to release, like a file.

Removing references to Disposable is needed if we want to move to uniffi-bindgen-kotlin-jni

See the ADR for details:
https://github.com/mozilla/uniffi-rs/blob/main/docs/adr/0008-freeing-objects-and-resources.md

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

This code comes from the UniFFI Kotlin bindings, but it's not needed
anymore.  Nowadays, UniFFI frees object references when the Kotlin
object is destroyed. The only reason to manually destroy an object is if
it holds a resource that you want to release, like a file.

Removing references to `Disposable` is needed if we want to move to
`uniffi-bindgen-kotlin-jni`

See the ADR for details:
https://github.com/mozilla/uniffi-rs/blob/main/docs/adr/0008-freeing-objects-and-resources.md
@bendk

bendk commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

This is based on general UniFFI patterns, but I don't know the specifics of what that destroy method is doing. Please double-check my reasoning here.

@bendk

bendk commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

..and after double-checking myself some more, there is infact still a Disposable interface in uniffi-bindgen-kotlin-jni, it's just in a different package now. So if you're not sure, I think we can keep the code more-or-less the same.

This branch has not been deployed

No deployments
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.

1 participant