From 7ee4f116f2002bbeb1261d625c9fedfb4060410c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Sat, 6 Aug 2022 22:09:22 +0200 Subject: [PATCH] Fix crash when load session w/o engine 1. Start Ardour, load a session. 2. Stop the engine 3. Session > Recent, pick a recent session 4. Engine dialog opens 5. Close engine dialog without starting the engine 6. Profit^WCrash --- libs/ardour/session.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 94786b4d0e..82d07c6be1 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -362,7 +362,12 @@ Session::Session (AudioEngine &eng, setup_lua (); - assert (AudioEngine::instance()->running()); + /* The engine sould be running at this point */ + if (!AudioEngine::instance()->running()) { + destroy (); + throw SessionException (_("Session initialization failed because Audio/MIDI engine is not running.")); + } + immediately_post_engine (); bool need_template_resave = false;