Merge pull request #32760 from SaracenOne/capture_buffer_cleanup

Fix to make sure the capture buffers are deallocated at shutdown.
This commit is contained in:
Rémi Verschelde 2019-10-12 08:15:34 +02:00 committed by GitHub
commit 94cb8cd6c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -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++) {

View file

@ -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; }