Пример #1
0
static void reserve_monitor_wrapper_free(pa_reserve_monitor_wrapper *w) {
    pa_assert(w);

#ifdef HAVE_DBUS
    if (w->monitor)
        rm_release(w->monitor);

    if (w->connection)
        pa_dbus_connection_unref(w->connection);
#endif

    pa_hook_done(&w->hook);

    if (w->shared_name) {
        pa_assert_se(pa_shared_remove(w->core, w->shared_name) >= 0);
        pa_xfree(w->shared_name);
    }

    pa_xfree(w);
}
Пример #2
0
static void reserve_wrapper_free(pa_reserve_wrapper *r) {
    pa_assert(r);

#ifdef HAVE_DBUS
    if (r->device)
        rd_release(r->device);

    if (r->connection)
        pa_dbus_connection_unref(r->connection);
#endif

    pa_hook_done(&r->hook);

    if (r->shared_name) {
        pa_assert_se(pa_shared_remove(r->core, r->shared_name) >= 0);
        pa_xfree(r->shared_name);
    }

    pa_xfree(r);
}
Пример #3
0
static void core_free(pa_object *o) {
    pa_core *c = PA_CORE(o);
    int j;
    pa_assert(c);

    c->state = PA_CORE_SHUTDOWN;

    /* Note: All modules and samples in the cache should be unloaded before
     * we get here */

    pa_assert(pa_idxset_isempty(c->scache));
    pa_idxset_free(c->scache, NULL);

    pa_assert(pa_idxset_isempty(c->modules));
    pa_idxset_free(c->modules, NULL);

    pa_assert(pa_idxset_isempty(c->clients));
    pa_idxset_free(c->clients, NULL);

    pa_assert(pa_idxset_isempty(c->cards));
    pa_idxset_free(c->cards, NULL);

    pa_assert(pa_idxset_isempty(c->sinks));
    pa_idxset_free(c->sinks, NULL);

    pa_assert(pa_idxset_isempty(c->sources));
    pa_idxset_free(c->sources, NULL);

    pa_assert(pa_idxset_isempty(c->source_outputs));
    pa_idxset_free(c->source_outputs, NULL);

    pa_assert(pa_idxset_isempty(c->sink_inputs));
    pa_idxset_free(c->sink_inputs, NULL);

    pa_assert(pa_hashmap_isempty(c->namereg));
    pa_hashmap_free(c->namereg);

    pa_assert(pa_hashmap_isempty(c->shared));
    pa_hashmap_free(c->shared);

    pa_assert(pa_hashmap_isempty(c->modules_pending_unload));
    pa_hashmap_free(c->modules_pending_unload);

    pa_subscription_free_all(c);

    if (c->exit_event)
        c->mainloop->time_free(c->exit_event);

    pa_assert(!c->default_source);
    pa_assert(!c->default_sink);

    pa_silence_cache_done(&c->silence_cache);
    if (c->rw_mempool)
        pa_mempool_free(c->rw_mempool);
    pa_mempool_free(c->mempool);

    for (j = 0; j < PA_CORE_HOOK_MAX; j++)
        pa_hook_done(&c->hooks[j]);
    for (j = 0; j < PA_ACCESS_HOOK_MAX; j++)
        pa_hook_done(&c->access[j]);

    pa_xfree(c);
}