fix(core): take over agent, reuse callbacks
- Kill running agents before replace - Retry copy with backoff while locked - Reuse syscall callbacks at package scope - Add callback regression test
This commit is contained in:
@@ -161,7 +161,9 @@ func attachInputDesktop() error {
|
||||
var (
|
||||
enumMu sync.Mutex
|
||||
enumBuf []rect
|
||||
enumCB = syscall.NewCallback(enumMonitor)
|
||||
// ponytail: syscall.NewCallback is process-global and never freed (~2000 max).
|
||||
// A closure here every frame is a fatal "too many callback functions".
|
||||
enumCB = syscall.NewCallback(enumMonitor)
|
||||
)
|
||||
|
||||
func enumMonitor(_ uintptr, _ uintptr, monitorRect uintptr, _ uintptr) uintptr {
|
||||
|
||||
Reference in New Issue
Block a user