Skip to content

Commit f684307

Browse files
committed
StreamCopyT destructor
1 parent ba2f996 commit f684307

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/AudioTools/CoreAudio/StreamCopy.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class StreamCopyT {
4141
begin();
4242
}
4343

44+
~StreamCopyT() {
45+
end();
46+
}
47+
4448
/// (Re)starts the processing
4549
void begin(){
4650
TRACED();
@@ -55,7 +59,10 @@ class StreamCopyT {
5559

5660
/// Ends the processing
5761
void end() {
58-
if (is_cleanup_from) delete this->from;
62+
if (is_cleanup_from) {
63+
delete this->from;
64+
is_cleanup_from = false;
65+
}
5966
this->from = nullptr;
6067
this->to = nullptr;
6168
}

0 commit comments

Comments
 (0)