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

deinit() can return an error even though checkError does not handle BAD_MUTEX_E #4

Open
DivergentClouds opened this issue Feb 28, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@DivergentClouds
Copy link

Version

c05b7eb

Description

Ideally, cleanup functions in zig should be non-failable, according to offical best practices (zig zen).

@DivergentClouds
Copy link
Author

The wolfssl docs state that the only error wolfSSL_cleanup can return is BAD_MUTEX_E

@kassane
Copy link
Owner

kassane commented Feb 29, 2024

Are you using the zig wrapper?

pub fn deinit(self: *WolfSSL) !void {
c.wolfSSL_free(self.ssl);
c.wolfSSL_CTX_free(self.ctx);
try checkError(c.wolfSSL_Cleanup());
}

Based on #2 it would be a work in progress, I can't guarantee that it will work correctly.
However, if you'd like to contribute to improving the wrapper, you'd be welcome to do so.

@kassane kassane added enhancement New feature or request good first issue Good for newcomers labels Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants