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
This commit is contained in:
Robin Gareus 2022-08-06 22:09:22 +02:00
parent 7408a9958e
commit 7ee4f116f2
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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;