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

Don't set _IS_INIT = true before initializing _ALGO_INSTANCE #16

Merged
merged 1 commit into from Dec 8, 2023

Conversation

jannic
Copy link
Member

@jannic jannic commented May 22, 2023

I hope I don't miss any subtle detail, but it looks wrong to set _IS_INIT before _ALGO_INSTANCE gets initialized. In case new returns Err, _ALGO_INSTANCE will stay uninitialized, but a later call to UnInit will still try to drop it.

As there is already a _IS_INIT = true immediately after setting _ALGO_INSTANCE, I think this line can just be removed.

@jannic
Copy link
Member Author

jannic commented May 22, 2023

CI fails because of changes in rustc. Fixed by #17.

I hope I don't miss any subtle detail, but it looks wrong to set
_IS_INIT before _ALGO_INSTANCE gets initialized. In case new
returns Err, _ALGO_INSTANCE will stay uninitialized, but a later call
to UnInit will still try to drop it.

As there is already a _IS_INIT = true immediately after setting
_ALGO_INSTANCE, I think this line can just be removed.
@thejpster
Copy link
Member

Rebased on main

@thejpster thejpster merged commit 7bb71a0 into main Dec 8, 2023
1 check passed
@thejpster thejpster deleted the fix-init-bookkeeping branch December 8, 2023 21:16
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.

None yet

2 participants