From f68430708f725a0c74789c884e1642da08cedf2d Mon Sep 17 00:00:00 2001 From: pschatzmann Date: Sun, 8 Dec 2024 10:16:22 +0100 Subject: [PATCH] StreamCopyT destructor --- src/AudioTools/CoreAudio/StreamCopy.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/AudioTools/CoreAudio/StreamCopy.h b/src/AudioTools/CoreAudio/StreamCopy.h index cce6c55a6..ba69f7d93 100644 --- a/src/AudioTools/CoreAudio/StreamCopy.h +++ b/src/AudioTools/CoreAudio/StreamCopy.h @@ -41,6 +41,10 @@ class StreamCopyT { begin(); } + ~StreamCopyT() { + end(); + } + /// (Re)starts the processing void begin(){ TRACED(); @@ -55,7 +59,10 @@ class StreamCopyT { /// Ends the processing void end() { - if (is_cleanup_from) delete this->from; + if (is_cleanup_from) { + delete this->from; + is_cleanup_from = false; + } this->from = nullptr; this->to = nullptr; }