You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
https://go.dev/play/p/k68Hr3YCWdP
when the C asynchronous callback, the runtime/cgo handle pointer has been freed by the gc, causing the wrong memory to be used during the callback
What did you expect to see?
keep the handle pointer until handle.Delete() is called
What did you see instead?
handle pointer has been freed by the gc
The text was updated successfully, but these errors were encountered:
@doujiang24 I temporarily use sync.map to save the pointer, I'm not sure if cgo handle should provide this feature.This example is just to show the problem I'm having
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://go.dev/play/p/k68Hr3YCWdP
when the C asynchronous callback, the runtime/cgo handle pointer has been freed by the gc, causing the wrong memory to be used during the callback
What did you expect to see?
keep the handle pointer until
handle.Delete()
is calledWhat did you see instead?
handle pointer has been freed by the gc
The text was updated successfully, but these errors were encountered: