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
Program crashes when unhooking #11
Comments
I've tried addressing your concerns in #12. It still isn't perfectly safe in my opinion but it is an improvement. |
Thank you so much for that! I tried the PR in my production and it partially fixes the issue, because it still crashes on unhooking from time to time. Wouldn't it be better to freeze all the threads while unhooking? I might be missing something but I don't see any thread-freezing related in unhook code while readme says |
When you call |
It freezes the threads when it acquires a builder from the factory: Lines 287 to 292 in c25ad1a
Yeah. I think I can further improve the safety by adding a mutex to |
I went ahead and implemented the mutex idea for all the *call methods since safety is a priority for this library I felt I should just keep it as fool-proof as possible (0c2147b). |
Thanks for the clarification 👍. I think mutex addresses the issue and don't experience with crashing when unhooking now |
Code to reproduce:
Although this can be "fixed" by checking nullptr for
hook
, it doesn't really live up to the library nameNote: The library used in the code is from Update README.md
The text was updated successfully, but these errors were encountered: