Skip to content

Commit cc0d538

Browse files
achronoppadenot
authored andcommitted
audiounit: guard counter with stream mutex similar to stream init. (#411)
1 parent cbc1d80 commit cc0d538

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/cubeb_audiounit.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2683,12 +2683,10 @@ audiounit_stream_destroy(cubeb_stream * stm)
26832683
dispatch_sync(stm->context->serial_queue, ^() {
26842684
auto_lock lock(stm->mutex);
26852685
audiounit_close_stream(stm);
2686+
assert(stm->context->active_streams >= 1);
2687+
stm->context->active_streams -= 1;
26862688
});
26872689

2688-
auto_lock context_lock(stm->context->mutex);
2689-
assert(stm->context->active_streams >= 1);
2690-
stm->context->active_streams -= 1;
2691-
26922690
LOG("Cubeb stream (%p) destroyed successful.", stm);
26932691
delete stm;
26942692
}

0 commit comments

Comments
 (0)