diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-10-12 08:15:34 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-12 08:15:34 +0200 |
commit | 94cb8cd6c595bb844917c03c87b7e551a7d62ab8 (patch) | |
tree | 6139340ebd00eb523b8573e209f9421ec46ccf96 | |
parent | a0c10ed492d550be40e06a70afecdf31aee0a3da (diff) | |
parent | dabaa11b3c451e9b8f2cca7e563bd9ec51edb169 (diff) |
Merge pull request #32760 from SaracenOne/capture_buffer_cleanup
Fix to make sure the capture buffers are deallocated at shutdown.
-rw-r--r-- | servers/audio_server.cpp | 1 | ||||
-rw-r--r-- | servers/audio_server.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/servers/audio_server.cpp b/servers/audio_server.cpp index 2cf6a67bef..1da0146084 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 72bb6faf42..da4b9daf5b 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; } |