12 struct pa_core* pa_core_new(struct pa_mainloop_api *m) {
14 c = malloc(sizeof(struct pa_core));
18 c->clients = pa_idxset_new(NULL, NULL);
19 c->sinks = pa_idxset_new(NULL, NULL);
20 c->sources = pa_idxset_new(NULL, NULL);
21 c->source_outputs = pa_idxset_new(NULL, NULL);
22 c->sink_inputs = pa_idxset_new(NULL, NULL);
24 c->default_source_index = c->default_sink_index = PA_IDXSET_INVALID;
29 pa_check_for_sigpipe();
34 void pa_core_free(struct pa_core *c) {
37 pa_module_unload_all(c);
40 assert(pa_idxset_isempty(c->clients));
41 pa_idxset_free(c->clients, NULL, NULL);
43 assert(pa_idxset_isempty(c->sinks));
44 pa_idxset_free(c->sinks, NULL, NULL);
46 assert(pa_idxset_isempty(c->sources));
47 pa_idxset_free(c->sources, NULL, NULL);
49 assert(pa_idxset_isempty(c->source_outputs));
50 pa_idxset_free(c->source_outputs, NULL, NULL);
52 assert(pa_idxset_isempty(c->sink_inputs));
53 pa_idxset_free(c->sink_inputs, NULL, NULL);