summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/polyp/context.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/polyp/context.c b/src/polyp/context.c
index ff224547..1e78f97f 100644
--- a/src/polyp/context.c
+++ b/src/polyp/context.c
@@ -784,18 +784,15 @@ static void set_dispatch_callbacks(pa_operation *o) {
done = 0;
}
- if (!done)
- pa_operation_ref(o);
- else {
+ if (done) {
if (o->callback) {
pa_context_notify_cb_t cb = (pa_context_notify_cb_t) o->callback;
cb(o->context, o->userdata);
}
pa_operation_done(o);
- }
-
- pa_operation_unref(o);
+ pa_operation_unref(o);
+ }
}
pa_operation* pa_context_drain(pa_context *c, pa_context_notify_cb_t cb, void *userdata) {