fix(apple): disarm CHHapticEngine handlers with no-ops, not nil
apple / swift (push) Successful in 55s
android / android (push) Failing after 1m58s
ci / rust (push) Failing after 1m13s
ci / web (push) Successful in 29s
ci / docs-site (push) Successful in 30s
decky / build-publish (push) Successful in 10s
deb / build-publish (push) Successful in 2m27s
docker / build-push (--build-arg FEDORA_VERSION=44, ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora44-rpm) (push) Successful in 4s
docker / build-push (., web/Dockerfile, punktfunk-web) (push) Successful in 4s
docker / build-push (ci, ci/fedora-rpm.Dockerfile, punktfunk-fedora-rpm) (push) Successful in 4s
docker / build-push (ci, ci/rust-ci.Dockerfile, punktfunk-rust-ci) (push) Successful in 5s
docker / build-push (docs-site, docs-site/Dockerfile, punktfunk-docs) (push) Successful in 4s
ci / bench (push) Successful in 4m31s
rpm / build-publish (fedora-44, punktfunk-fedora44-rpm) (push) Has been cancelled
rpm / build-publish (bazzite, punktfunk-fedora-rpm) (push) Has been cancelled
docker / deploy-docs (push) Successful in 24s

stoppedHandler/resetHandler are non-optional closures on the CI SDK
((StoppedReason)->() and ()->()), so assigning nil fails to compile
(apple.yml). Assign no-op closures to disarm them before engine.stop()
-- same re-entrancy guard intent, type-correct.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-18 21:20:37 +00:00
parent d9d495a53e
commit 7121b0eb43
@@ -186,9 +186,10 @@ private final class RumbleRenderer: @unchecked Sendable {
private func teardown() {
for m in [low, high].compactMap({ $0 }) {
// Drop the handlers before stopping so stop() can't re-enter teardown via stoppedHandler.
m.engine.stoppedHandler = nil
m.engine.resetHandler = nil
// Disarm the handlers before stopping so stop() can't re-enter teardown via them.
// (Both properties are non-optional closures on this SDK, so assign no-ops, not nil.)
m.engine.stoppedHandler = { _ in }
m.engine.resetHandler = {}
try? m.player.stop(atTime: CHHapticTimeImmediate)
m.engine.stop()
}