From dabaa11b3c451e9b8f2cca7e563bd9ec51edb169 Mon Sep 17 00:00:00 2001 From: Saracen Date: Fri, 11 Oct 2019 23:40:43 +0100 Subject: [PATCH] Fix to make sure the capture buffers are deallocated at shutdown. Silences warnings. --- servers/audio_server.cpp | 1 + servers/audio_server.h | 2 ++ 2 files changed, 3 insertions(+) diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 2cf6a67befa..1da01460840 100644 --- a/servers/audio_server.cpp +++ b/servers/audio_server.cpp @@ -1079,6 +1079,7 @@ void AudioServer::finish() { for (int i = 0; i < AudioDriverManager::get_driver_count(); i++) { AudioDriverManager::get_driver(i)->finish(); + AudioDriverManager::get_driver(i)->clear_capture_buffer(); } for (int i = 0; i < buses.size(); i++) { diff --git a/servers/audio_server.h b/servers/audio_server.h index 72bb6faf422..da4b9daf5b3 100644 --- a/servers/audio_server.h +++ b/servers/audio_server.h @@ -115,6 +115,8 @@ public: unsigned int get_capture_position() { return capture_position; } unsigned int get_capture_size() { return capture_size; } + void clear_capture_buffer() { capture_buffer.resize(0); } + #ifdef DEBUG_ENABLED uint64_t get_profiling_time() const { return prof_time; } void reset_profiling_time() { prof_time = 0; }