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

Cleanup callback code and test callback lifetimes #59

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

arg0d
Copy link
Collaborator

@arg0d arg0d commented Sep 13, 2024

  1. Test callback lifetime. Equivalent of Test callback lifetime mozilla/uniffi-rs#2230

The code looks like it should have the equivalent issue as NordSecurity/uniffi-bindgen-cs#79, but because pointers were taken to local variables, each pointer was unique, and received a unique handle.

  1. Store generic type directly in concurrentHandleMap, not via pointer. Remove rightMap, as it actually doesn't do anything, and only creates issues. (Dropping single callback reference invalidates the entire callback uniffi-bindgen-cs#79)

@arg0d arg0d requested a review from Savolro September 13, 2024 12:39
1) Test callback lifetime. Equivalent of
mozilla/uniffi-rs#2230

The code looks like it should have the equivalent issue as
NordSecurity/uniffi-bindgen-cs#79, but because
pointers were taken to local variables, each pointer was unique, and
received a unique handle.

2) Store generic type directly in concurrentHandleMap, not via pointer.
Remove `rightMap`, as it actually doesn't do anything, and only creates
issues. (NordSecurity/uniffi-bindgen-cs#79)

Signed-off-by: Kristupas Antanavičius <[email protected]>
@arg0d arg0d force-pushed the kristupas/callback-reference-lifetimes branch from fb12940 to a7b2ef4 Compare September 13, 2024 12:43
@arg0d arg0d merged commit a77dc04 into main Oct 4, 2024
3 checks passed
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