Closed kegsay closed 7 months ago
https://github.com/NordSecurity/uniffi-bindgen-go/blob/62347acdf3c00efc54398ef6f0fc3f93e9578df4/bindgen/templates/CallbackInterfaceRuntime.go#L46-L48
Can cause fatal error: concurrent map read and map write as the read is not protected with a mutex.
fatal error: concurrent map read and map write
I'd suggest replacing lock sync.Mutex with a sync.RWMutex.
lock sync.Mutex
sync.RWMutex
I think concurrentHandleMap can be replaced entirely by using cgo.Handle instead.
cgo.Handle
Thanks for the report, good catch :+1:
https://github.com/NordSecurity/uniffi-bindgen-go/blob/62347acdf3c00efc54398ef6f0fc3f93e9578df4/bindgen/templates/CallbackInterfaceRuntime.go#L46-L48
Can cause
fatal error: concurrent map read and map write
as the read is not protected with a mutex.I'd suggest replacing
lock sync.Mutex
with async.RWMutex
.