return m;
}
-void pa_stream_manager_unref(pa_stream_manager *m) {
- void *state;
- pa_idxset *streams;
-
+static void free_hook_slots(pa_stream_manager *m) {
pa_assert(m);
- pa_assert(PA_REFCNT_VALUE(m) > 0);
-
- pa_log_info("pa_stream_manager_unref to %d", PA_REFCNT_VALUE(m) - 1);
- if (PA_REFCNT_DEC(m) > 0)
- return;
-
- if (m->comm.comm) {
- if (m->comm.comm_hook_device_connection_changed_slot)
- pa_hook_slot_free(m->comm.comm_hook_device_connection_changed_slot);
- if (m->comm.comm_hook_event_fully_handled_slot)
- pa_hook_slot_free(m->comm.comm_hook_event_fully_handled_slot);
- pa_communicator_unref(m->comm.comm);
- }
-
- if (m->subscription)
- pa_subscription_free(m->subscription);
+ if (m->comm.comm_hook_device_connection_changed_slot)
+ pa_hook_slot_free(m->comm.comm_hook_device_connection_changed_slot);
+ if (m->comm.comm_hook_event_fully_handled_slot)
+ pa_hook_slot_free(m->comm.comm_hook_event_fully_handled_slot);
if (m->sink_input_new_slot)
pa_hook_slot_free(m->sink_input_new_slot);
if (m->sink_input_put_slot)
pa_hook_slot_free(m->source_output_move_start_slot);
if (m->source_output_move_finish_slot)
pa_hook_slot_free(m->source_output_move_finish_slot);
+}
+
+void pa_stream_manager_unref(pa_stream_manager *m) {
+ void *state;
+ pa_idxset *streams;
+
+ pa_assert(m);
+ pa_assert(PA_REFCNT_VALUE(m) > 0);
+
+ pa_log_info("pa_stream_manager_unref to %d", PA_REFCNT_VALUE(m) - 1);
+ if (PA_REFCNT_DEC(m) > 0)
+ return;
+
+ free_hook_slots(m);
+
+ if (m->comm.comm)
+ pa_communicator_unref(m->comm.comm);
+
+ if (m->subscription)
+ pa_subscription_free(m->subscription);
if (m->muted_streams) {
PA_HASHMAP_FOREACH(streams, m->muted_streams, state)