fix: pool usa CdpClose(c,0) en vez de CdpDisconnect (evita drift falso en uses_functions)
El wrapper CdpDisconnect comparte entry de registry con CdpClose; el auditor uses_functions no lo reconoce como mismo símbolo y marcaba cdp_close como declared-but-unused. CdpClose(c,0) expresa lo mismo sin drift.
This commit is contained in:
@@ -48,9 +48,9 @@ func (p *connPool) drop(port int) {
|
||||
}
|
||||
delete(p.dialogLogs, port)
|
||||
if c, ok := p.conns[port]; ok && c != nil {
|
||||
// CdpDisconnect = cerrar el WebSocket sin matar Chrome (el navegador
|
||||
// sigue vivo; solo soltamos la sesión pooled).
|
||||
_ = browser.CdpDisconnect(c)
|
||||
// pid=0: cerrar solo el WebSocket, sin matar Chrome (el navegador sigue
|
||||
// vivo; solo soltamos la sesión pooled).
|
||||
_ = browser.CdpClose(c, 0)
|
||||
delete(p.conns, port)
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ func (p *connPool) closeAll() {
|
||||
cancel()
|
||||
}
|
||||
if c != nil {
|
||||
_ = browser.CdpDisconnect(c)
|
||||
_ = browser.CdpClose(c, 0)
|
||||
}
|
||||
}
|
||||
p.conns = map[int]*browser.CDPConn{}
|
||||
|
||||
Reference in New Issue
Block a user