u->core = m->core;
u->module = m;
u->connection = connection;
- u->sessions = pa_hashmap_new(pa_idxset_string_hash_func, pa_idxset_string_compare_func);
+ u->sessions = pa_hashmap_new_full(pa_idxset_string_hash_func, pa_idxset_string_compare_func, NULL, (pa_free_cb_t) free_session);
if (!dbus_connection_add_filter(pa_dbus_connection_get(connection), filter_cb, u, NULL)) {
pa_log_error("Failed to add filter function");
return;
if (u->sessions)
- pa_hashmap_free(u->sessions, (pa_free_cb_t) free_session);
+ pa_hashmap_free(u->sessions);
if (u->connection) {
pa_dbus_remove_matches(