From 4b3f97c65dc63050878347b975bc36ea07a11ebf Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 13 Sep 2022 23:50:15 +0100 Subject: [PATCH] c/multi: State paranioa --- src/xrt/compositor/multi/comp_multi_system.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/xrt/compositor/multi/comp_multi_system.c b/src/xrt/compositor/multi/comp_multi_system.c index 6c50b786c..f68068011 100644 --- a/src/xrt/compositor/multi/comp_multi_system.c +++ b/src/xrt/compositor/multi/comp_multi_system.c @@ -392,12 +392,23 @@ update_session_state_locked(struct multi_system_compositor *msc) break; case MULTI_SYSTEM_STATE_STOPPING: + // Just in case + if (msc->sessions.active_count > 0) { + U_LOG_I("Restarting main session, %u active app session(s).", + (uint32_t)msc->sessions.active_count); + msc->sessions.state = MULTI_SYSTEM_STATE_RUNNING; + break; + } + U_LOG_I("Stopped main session, %u active app session(s).", (uint32_t)msc->sessions.active_count); msc->sessions.state = MULTI_SYSTEM_STATE_STOPPED; xrt_comp_end_session(xc); break; - default: assert(false); + default: + U_LOG_E("Got invalid state %u", msc->sessions.state); + msc->sessions.state = MULTI_SYSTEM_STATE_STOPPING; + assert(false); } }