-
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: keep alive structs for C usage
When accessing C fields or functions, there was a potential race condition with the garbage collector running the finalizer if the object was no longer referenced elsewhere. This race was (mostly) short, but arguably still existed. Use KeepAlive() to safeguard these accesses and ensure the object is only garbage collected (and the C part freed) once the access has finished.
- Loading branch information
1 parent
07fb25c
commit 1bab2fc
Showing
2 changed files
with
34 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters