diff options
Diffstat (limited to 'src')
-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& |