ladishd: stop apps on studio stop

This commit is contained in:
Nedko Arnaudov 2009-12-05 00:54:41 +02:00
parent 0b6ad2626f
commit 2bbcd652a8
3 changed files with 20 additions and 0 deletions

View File

@ -377,6 +377,23 @@ void ladish_app_supervisor_autorun(ladish_app_supervisor_handle supervisor_handl
}
}
void ladish_app_supervisor_stop(ladish_app_supervisor_handle supervisor_handle)
{
struct list_head * node_ptr;
struct ladish_app * app_ptr;
list_for_each(node_ptr, &supervisor_ptr->applist)
{
app_ptr = list_entry(node_ptr, struct ladish_app, siblings);
if (app_ptr->pid != 0)
{
app_ptr->autorun = true;
log_info("terminating '%s'...", app_ptr->name);
kill(app_ptr->pid, SIGTERM);
}
}
}
#undef supervisor_ptr
#define supervisor_ptr ((struct ladish_app_supervisor *)call_ptr->iface_context)

View File

@ -53,6 +53,7 @@ ladish_app_supervisor_add(
bool terminal,
uint8_t level);
void ladish_app_supervisor_stop(ladish_app_supervisor_handle supervisor_handle);
void ladish_app_supervisor_autorun(ladish_app_supervisor_handle supervisor_handle);
extern const struct dbus_interface_descriptor g_iface_app_supervisor;

View File

@ -43,6 +43,8 @@ static bool run(void * context)
return true;
}
ladish_app_supervisor_stop(g_studio.app_supervisor);
log_info("Stopping JACK server...");
ladish_graph_dump(g_studio.studio_graph);