int pa_shared_replace(pa_core *c, const char *name, void *data) { pa_assert(c); pa_assert(name); (void) pa_shared_remove(c, name); return pa_shared_set(c, name, data); }
void pa_auth_cookie_unref(pa_auth_cookie *c) { pa_assert(c); pa_assert(PA_REFCNT_VALUE(c) >= 1); if (PA_REFCNT_DEC(c) > 0) return; pa_assert_se(pa_shared_remove(c->core, c->name) >= 0); pa_xfree(c->name); pa_xfree(c); }
void pa_dbus_connection_unref(pa_dbus_connection *c) { pa_assert(c); pa_assert(PA_REFCNT_VALUE(c) > 0); if (PA_REFCNT_DEC(c) > 0) return; pa_dbus_wrap_connection_free(c->connection); pa_shared_remove(c->core, c->property_name); pa_xfree(c); }
void pa_simple_protocol_unref(pa_simple_protocol *p) { connection *c; pa_assert(p); pa_assert(PA_REFCNT_VALUE(p) >= 1); if (PA_REFCNT_DEC(p) > 0) return; while ((c = pa_idxset_first(p->connections, NULL))) connection_unlink(c); pa_idxset_free(p->connections, NULL); pa_assert_se(pa_shared_remove(p->core, "simple-protocol") >= 0); pa_xfree(p); }
static void x11_wrapper_free(pa_x11_wrapper*w) { pa_assert(w); pa_assert_se(pa_shared_remove(w->core, w->property_name) >= 0); pa_assert(!w->clients); XRemoveConnectionWatch(w->display, x11_watch, (XPointer) w); XCloseDisplay(w->display); w->core->mainloop->io_free(w->io_event); w->core->mainloop->defer_free(w->defer_event); while (w->internals) x11_internal_remove(w, w->internals); pa_xfree(w->property_name); pa_xfree(w); }
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); }
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); }