Fix opening sessions using the Finder (OSX)
The ShouldLoad() signal is handled by flush_pending(). This is the first time that normal application flow can be interrupted in ::starting() after app->ready(). This calls ::load_from_application_api(), which in turn calls startup_fsm->handle_path(). This sets off the complete initalization process, loading the session, and concludes with ::sfsm_response(), where there is a call to `delete startup_fsm;` Previously execution continued in StartupFSM::start() which caused a crash.
This commit is contained in:
parent
650fd31332
commit
cda2e004a8
@ -471,10 +471,11 @@ ARDOUR_UI::sfsm_response (StartupFSM::Result r)
|
||||
case StartupFSM::LoadSession:
|
||||
|
||||
if (load_session_from_startup_fsm () == 0) {
|
||||
startup_done ();
|
||||
delete startup_fsm;
|
||||
startup_fsm = 0;
|
||||
startup_done ();
|
||||
} else {
|
||||
DEBUG_TRACE (DEBUG::GuiStartup, "FSM reset\n");
|
||||
startup_fsm->reset ();
|
||||
}
|
||||
|
||||
@ -519,6 +520,16 @@ ARDOUR_UI::starting ()
|
||||
startup_fsm = new StartupFSM (*amd);
|
||||
startup_fsm->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::sfsm_response));
|
||||
|
||||
|
||||
/* allow signals to be handled, ShouldLoad() from flush-pending */
|
||||
Splash::instance()->pop_front();
|
||||
flush_pending ();
|
||||
|
||||
if (!startup_fsm) {
|
||||
DEBUG_TRACE (DEBUG::GuiStartup, "Starting: SFSM was driven by flush-pending\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Note: entire startup process could happen in this one call
|
||||
* if:
|
||||
*
|
||||
@ -788,6 +799,7 @@ ARDOUR_UI::load_from_application_api (const std::string& path)
|
||||
* 3) no audio/MIDI setup required
|
||||
*/
|
||||
|
||||
Splash::instance()->pop_front();
|
||||
startup_fsm->start ();
|
||||
}
|
||||
}
|
||||
|
@ -127,11 +127,6 @@ StartupFSM::queue_finish ()
|
||||
void
|
||||
StartupFSM::start ()
|
||||
{
|
||||
/* get the splash screen visible, if it isn't yet */
|
||||
Splash::instance()->pop_front();
|
||||
/* make it all happen on-screen */
|
||||
ARDOUR_UI::instance()->flush_pending ();
|
||||
|
||||
DEBUG_TRACE (DEBUG::GuiStartup, string_compose (X_("State at startup: %1\n"), enum_2_string (_state)));
|
||||
|
||||
switch (_state) {
|
||||
@ -144,6 +139,9 @@ StartupFSM::start ()
|
||||
case WaitingForSessionPath:
|
||||
handle_waiting_for_session_path ();
|
||||
break;
|
||||
case WaitingForEngineParams:
|
||||
start_audio_midi_setup ();
|
||||
break;
|
||||
default:
|
||||
fatal << string_compose (_("Programming error: %1"), string_compose (X_("impossible starting state in StartupFSM (%1)"), enum_2_string (_state))) << endmsg;
|
||||
std::cerr << string_compose (_("Programming error: %1"), string_compose (X_("impossible starting state in StartupFSM (%1)"), enum_2_string (_state))) << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user