diff --git a/src/cubeb_audiounit.cpp b/src/cubeb_audiounit.cpp index 6bf0e3d..f1b053e 100644 --- a/src/cubeb_audiounit.cpp +++ b/src/cubeb_audiounit.cpp @@ -139,7 +139,7 @@ struct cubeb { // Store list of devices to detect changes vector input_device_array; vector output_device_array; - // The queue is asynchronously deallocated once all references to it are released + // The queue should be released when it’s no longer needed. dispatch_queue_t serial_queue = dispatch_queue_create(DISPATCH_QUEUE_LABEL, DISPATCH_QUEUE_SERIAL); // Current used channel layout atomic layout{ CUBEB_LAYOUT_UNDEFINED }; @@ -1432,6 +1432,8 @@ audiounit_destroy(cubeb * ctx) } } + dispatch_release(ctx->serial_queue); + delete ctx; }