p = pa_xnew(pa_dbus_protocol, 1);
PA_REFCNT_INIT(p);
- p->core = c;
+ p->core = pa_core_ref(c);
p->objects = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
p->connections = pa_hashmap_new(pa_idxset_trivial_hash_func, pa_idxset_trivial_compare_func);
p->extensions = pa_idxset_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
pa_assert_se(pa_shared_remove(p->core, "dbus-protocol") >= 0);
+ pa_core_unref(p->core);
+
pa_xfree(p);
}