From 97e6110045298250c627eba5b10b7d96aec5a31a Mon Sep 17 00:00:00 2001 From: aineoae86-sys Date: Sun, 5 Jul 2026 19:44:25 +0800 Subject: [PATCH] fix: keep Tone pin owned until destruction Tone::stop() only needs to detach the ticker. Clearing the pin pointer before the destructor runs leaks the DigitalOut allocated by the constructor. Fixes #1073 Generated-by: OpenAI Codex Signed-off-by: aineoae86-sys --- cores/arduino/Tone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/cores/arduino/Tone.cpp b/cores/arduino/Tone.cpp index f02e4e936..a80e62237 100644 --- a/cores/arduino/Tone.cpp +++ b/cores/arduino/Tone.cpp @@ -37,7 +37,6 @@ class Tone { void stop(void) { ticker.detach(); - pin = 0; } void start_timeout(void) {