mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-10 13:29:58 -05:00
memblock: multiple references should make blocks read-only
The old code makes no sense to me. Why would multiple references mean that a previously read-only memblock is suddenly writable? I'm pretty sure that the original intention was to treat multi-referenced blocks as read-only. I don't have any examples where the old code would have caused bad behaviour, however.
This commit is contained in:
parent
2432270a73
commit
a604d9cbb3
1 changed files with 1 additions and 1 deletions
|
|
@ -497,7 +497,7 @@ bool pa_memblock_is_read_only(pa_memblock *b) {
|
|||
pa_assert(b);
|
||||
pa_assert(PA_REFCNT_VALUE(b) > 0);
|
||||
|
||||
return b->read_only && PA_REFCNT_VALUE(b) == 1;
|
||||
return b->read_only || PA_REFCNT_VALUE(b) > 1;
|
||||
}
|
||||
|
||||
/* No lock necessary */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue