summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-07-13 12:12:40 +0000
committerLennart Poettering <lennart@poettering.net>2007-07-13 12:12:40 +0000
commit63c231ed36f834a62b3a0f8cc21756ecc6d8533e (patch)
tree4a77166dc83dfa8fca296d8fd76b2715b7e6ca0e
parent481b425a28ac02246fc051ab1e9f9a65f2701cf4 (diff)
Fix concurrency bug when turning memblock into a local memblock
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1514 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/pulsecore/memblock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pulsecore/memblock.c b/src/pulsecore/memblock.c
index 71b576ac..e5df11f7 100644
--- a/src/pulsecore/memblock.c
+++ b/src/pulsecore/memblock.c
@@ -567,10 +567,10 @@ void pa_memblock_unref_fixed(pa_memblock *b) {
assert(PA_REFCNT_VALUE(b) > 0);
assert(b->type == PA_MEMBLOCK_FIXED);
- if (PA_REFCNT_DEC(b) > 0)
+ if (PA_REFCNT_VALUE(b) > 1)
memblock_make_local(b);
- else
- memblock_free(b);
+
+ pa_memblock_unref(b);
}
/* Self-locked. This function is not multiple-caller safe */