11 struct pa_core* pa_core_new(struct pa_mainloop_api *m) {
13 c = malloc(sizeof(struct pa_core));
17 c->clients = pa_idxset_new(NULL, NULL);
18 c->sinks = pa_idxset_new(NULL, NULL);
19 c->sources = pa_idxset_new(NULL, NULL);
20 c->source_outputs = pa_idxset_new(NULL, NULL);
21 c->sink_inputs = pa_idxset_new(NULL, NULL);
23 c->default_source_index = c->default_sink_index = PA_IDXSET_INVALID;
31 void pa_core_free(struct pa_core *c) {
34 pa_module_unload_all(c);
37 assert(pa_idxset_isempty(c->clients));
38 pa_idxset_free(c->clients, NULL, NULL);
40 assert(pa_idxset_isempty(c->sinks));
41 pa_idxset_free(c->sinks, NULL, NULL);
43 assert(pa_idxset_isempty(c->sources));
44 pa_idxset_free(c->sources, NULL, NULL);
46 assert(pa_idxset_isempty(c->source_outputs));
47 pa_idxset_free(c->source_outputs, NULL, NULL);
49 assert(pa_idxset_isempty(c->sink_inputs));
50 pa_idxset_free(c->sink_inputs, NULL, NULL);