pulse: destroy context immediately

The mainloop might not run anymore to actually destroy the context.
This commit is contained in:
Wim Taymans 2020-09-15 20:31:09 +02:00
parent 05ae8a24de
commit 23e7a54340

View file

@ -1584,12 +1584,6 @@ pa_context *pa_context_new_with_proplist(pa_mainloop_api *mainloop, const char *
return c; return c;
} }
static void do_context_destroy(pa_mainloop_api*m, void *userdata)
{
pa_context *c = userdata;
pw_context_destroy(c->context);
}
static void context_free(pa_context *c) static void context_free(pa_context *c)
{ {
pw_log_debug("context %p: free", c); pw_log_debug("context %p: free", c);
@ -1602,7 +1596,7 @@ static void context_free(pa_context *c)
if (c->core_info) if (c->core_info)
pw_core_info_free(c->core_info); pw_core_info_free(c->core_info);
pa_mainloop_api_once(c->mainloop, do_context_destroy, c); pw_context_destroy(c->context);
} }
SPA_EXPORT SPA_EXPORT