if (u->ignore)
return PA_HOOK_OK;
+ /* There's no point in doing anything if the core is shut down anyway */
+ if (c->state == PA_CORE_SHUTDOWN)
+ return PA_HOOK_OK;
+
/* Auto-loaded null-sink not active, so ignoring newly detected sink. */
if (u->null_module == PA_INVALID_INDEX)
return PA_HOOK_OK;
return PA_HOOK_OK;
}
+ /* There's no point in doing anything if the core is shut down anyway */
+ if (c->state == PA_CORE_SHUTDOWN)
+ return PA_HOOK_OK;
+
load_null_sink_if_needed(c, sink, u);
return PA_HOOK_OK;
pa_hook_slot_free(u->put_slot);
if (u->unlink_slot)
pa_hook_slot_free(u->unlink_slot);
- if (u->null_module != PA_INVALID_INDEX)
+ if (u->null_module != PA_INVALID_INDEX && m->core->state != PA_CORE_SHUTDOWN)
pa_module_unload_request_by_index(m->core, u->null_module, TRUE);
pa_xfree(u->sink_name);
pa_assert(c);
pa_assert(sink);
+ /* There's no point in doing anything if the core is shut down anyway */
+ if (c->state == PA_CORE_SHUTDOWN)
+ return PA_HOOK_OK;
+
if (!pa_idxset_size(sink->inputs)) {
pa_log_debug("No sink inputs to move away.");
return PA_HOOK_OK;
pa_assert(c);
pa_assert(source);
+ /* There's no point in doing anything if the core is shut down anyway */
+ if (c->state == PA_CORE_SHUTDOWN)
+ return PA_HOOK_OK;
+
if (!pa_idxset_size(source->outputs)) {
pa_log_debug("No source outputs to move away.");
return PA_HOOK_OK;