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

lib/c-api: fix env_finalizer being ran everytime WrapperEnv was dropped #2872

Merged
merged 1 commit into from
May 6, 2022

Conversation

epilys
Copy link
Contributor

@epilys epilys commented May 6, 2022

We would like to run the environment finalizer callback only when the
last reference to env pointer is dropped, which is when the Arc<_>
reference count is one.

Closes #2871

@epilys epilys added the 📦 lib-c-api About wasmer-c-api label May 6, 2022
@epilys epilys requested a review from Amanieu May 6, 2022 16:09
@epilys epilys self-assigned this May 6, 2022
…opped

We would like to run the environment finalizer callback only when the
last reference to env pointer is dropped, which is when the Arc<_>
reference count is one.

Closes #2871
@epilys
Copy link
Contributor Author

epilys commented May 6, 2022

bors r+

@epilys epilys removed the request for review from Amanieu May 6, 2022 18:55
bors bot added a commit that referenced this pull request May 6, 2022
2872: lib/c-api: fix env_finalizer being ran everytime WrapperEnv was dropped r=epilys a=epilys

We would like to run the environment finalizer callback only when the
last reference to env pointer is dropped, which is when the Arc<_>
reference count is one.

Closes #2871

Co-authored-by: Manos Pitsidianakis <[email protected]>
@bors
Copy link
Contributor

bors bot commented May 6, 2022

Timed out.

@syrusakbary syrusakbary merged commit 142560d into master May 6, 2022
@bors bors bot deleted the fix-2871 branch May 6, 2022 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 lib-c-api About wasmer-c-api
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Finalizer is called twice when using the wasm_func_new_with_env function in the C API
2 participants