diff options
Diffstat (limited to 'polyp/polyplib-context.c')
-rw-r--r-- | polyp/polyplib-context.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/polyp/polyplib-context.c b/polyp/polyplib-context.c index 9acb2d70..7542dd9b 100644 --- a/polyp/polyplib-context.c +++ b/polyp/polyplib-context.c @@ -463,7 +463,10 @@ static void set_dispatch_callbacks(struct pa_operation *o) { struct pa_operation* pa_context_drain(struct pa_context *c, void (*cb) (struct pa_context*c, void *userdata), void *userdata) { struct pa_operation *o; - assert(c && c->ref >= 1 && c->state == PA_CONTEXT_READY); + assert(c && c->ref >= 1); + + if (c->state != PA_CONTEXT_READY) + return NULL; if (!pa_context_is_pending(c)) return NULL; |