fix(audio,macos): address PR #27 review findings
- ios_voice_unit.rs: add producer_shutdown AtomicBool flag (macOS only). The macOS start path spawns a tokio producer task that holds clones of Arc<Mutex<AudioHandler>>, Arc<ArrayQueue<f32>>, and the output gain/muted atomics, then loops on a 20 ms tokio interval. Without a shutdown signal the task runs forever on engine stop/restart and leaks all four Arcs every cycle. Drop now stores 'true' on the flag; the producer checks it at the top of each tick and exits, releasing its clones within at most one 20 ms tick. - macos/Runner/Release.entitlements: strengthen the existing justification comment for com.apple.security.network.server. Document the specific failure mode (tokio::net::UdpSocket::bind -> sandbox 'network-outbound deny' -> EPERM) and explain why network.client alone does not cover bind()-then-sendto. The entitlement is required, not over-broad. cargo check (host + aarch64-apple-darwin): clean cargo test -p chanora_audio --lib: 133 passed flutter test: 186 passed, 2 skipped dart analyze: clean
This commit is contained in:
@@ -4,9 +4,12 @@
|
||||
<dict>
|
||||
<!-- Release builds omit cs.allow-jit (Flutter hot-reload only). They keep
|
||||
network.server because the macOS App Sandbox treats every UDP bind()
|
||||
- including the ephemeral 0.0.0.0:0 that tsclientlib uses for
|
||||
outbound traffic - as a server operation. Without this entitlement
|
||||
UdpSocket::bind fails with EPERM and the TS3 connect never starts. -->
|
||||
- including the ephemeral 0.0.0.0:0 that tsclientlib's
|
||||
tokio::net::UdpSocket::bind() issues for outbound traffic - as a
|
||||
server operation. Without this entitlement UdpSocket::bind fails
|
||||
with EPERM (sandbox_init: 'network-outbound deny') and the TS3
|
||||
connect never starts. network.client alone is insufficient because
|
||||
it gates connect()-style flows, not bind()-then-sendto. -->
|
||||
<key>com.apple.security.app-sandbox</key>
|
||||
<true/>
|
||||
<key>com.apple.security.network.client</key>
|
||||
|
||||
Reference in New Issue
Block a user