diff options
author | David Robillard <d@drobilla.net> | 2020-11-11 22:57:19 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-11 22:57:19 +0100 |
commit | 81c29ac104e4bec8751091fd7cc8fd0047cf13f7 (patch) | |
tree | 32d0f7589d363cf787af4ec5d6394f41d2b1ca3f /src/server | |
parent | 7dcb23cde02b9daaef42dd7bb531741b518337ff (diff) | |
download | ingen-81c29ac104e4bec8751091fd7cc8fd0047cf13f7.tar.gz ingen-81c29ac104e4bec8751091fd7cc8fd0047cf13f7.tar.bz2 ingen-81c29ac104e4bec8751091fd7cc8fd0047cf13f7.zip |
Fix buffer memory leaks on shutdown
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/BufferFactory.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/BufferFactory.cpp b/src/server/BufferFactory.cpp index 2de18ee8..c606c8cd 100644 --- a/src/server/BufferFactory.cpp +++ b/src/server/BufferFactory.cpp @@ -46,10 +46,14 @@ BufferFactory::BufferFactory(Engine& engine, URIs& uris) BufferFactory::~BufferFactory() { _silent_buffer.reset(); - free_list(_free_audio.load()); - free_list(_free_control.load()); - free_list(_free_sequence.load()); - free_list(_free_object.load()); + + // Run twice to delete value buffer references which are dropped + for (unsigned i = 0; i < 2; ++i) { + free_list(_free_audio.exchange(nullptr)); + free_list(_free_control.exchange(nullptr)); + free_list(_free_sequence.exchange(nullptr)); + free_list(_free_object.exchange(nullptr)); + } } Forge& |