This repository was archived by the owner on Jul 30, 2025. It is now read-only.
Fix/progress callback crash #220
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses the issue described in #134.
It fixes the issue here "on my machine", and I was waiting for someone else in the issue thread to confirm that it works elsewhere without introducing new bugs. My comment didn't get much attention however, so here we are.
The fix essentially is in this commit: rasteiner@807bc24
It essentially reproduces the same technique which is used elsewhere in the same code file: boxing the callback twice and then calling
into_raw. Seeset_segment_callback_safe,set_segment_callback_safe_lossyandset_abort_callback_safe.set_progress_callback_safewas the only place where&mut closure as *mut F as *mut c_voidwas used.The other commits fix a spelling error of "progess" -> "progress" and merge unrelated new code from master.