- if (verbose) fprintf (stderr, "Found matching sink : %s\n", info->name);
- pa_mainloop_quit (dev_ctx_p_t->pa_loop, num);
+ fprintf (stderr, "Found matching sink : %s\n", info->name);
+ /* we return num+1 because '0' is already used */
+ pa_mainloop_quit (dev_ctx_p_t->pa_loop, num+1);
+ pa_context_disconnect (dev_ctx_p_t->pa_context);
+ pa_context_unref (dev_ctx_p_t->pa_context);
+ pa_mainloop_free (dev_ctx_p_t->pa_loop);