From c421ffb6e3aec7656e910afc7cd1e9c8260a62f8 Mon Sep 17 00:00:00 2001 From: KinoMyu Date: Tue, 6 Feb 2018 03:00:01 -0800 Subject: [PATCH] Fixed BASS SYNC memory leak --- src/HCAStreamChannel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/HCAStreamChannel.cpp b/src/HCAStreamChannel.cpp index aedf21a..c9285e5 100644 --- a/src/HCAStreamChannel.cpp +++ b/src/HCAStreamChannel.cpp @@ -64,8 +64,8 @@ void HCAStreamChannel::wait_for_decode() void HCAStreamChannel::unload() { dec->cancel_decode(ptr); - if (playback_channel != 0) { BASS_ChannelStop(playback_channel); playback_channel = 0; } - if (decode_channel != 0) { BASS_ChannelStop(decode_channel); decode_channel = 0; } + if (playback_channel != 0) { BASS_StreamFree(playback_channel); playback_channel = 0; } + if (decode_channel != 0) { BASS_StreamFree(decode_channel); decode_channel = 0; } if (ptr != nullptr) { delete[] ptr; ptr = nullptr; } size = 0; } @@ -110,7 +110,7 @@ bool HCAStreamChannel::__load() dec->cancel_decode(ptr); delete[] ptr; ptr = nullptr; - BASS_ChannelStop(playback_channel); + BASS_StreamFree(playback_channel); playback_channel = 0; size = 0; return false; @@ -154,7 +154,7 @@ void HCAStreamChannel::make_channels() decode_channel = BASS_StreamCreateFile(TRUE, ptr, 0, size, flags | BASS_STREAM_DECODE); if (decode_channel == 0) { - BASS_ChannelStop(playback_channel); + BASS_StreamFree(playback_channel); playback_channel = 0; } }