diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2008-01-13 16:38:58 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2008-01-13 16:38:58 +0000 |
commit | 5190d2ac4fe8f3eb4deb3f40190d301196e3247e (patch) | |
tree | 91df90515ae6e9ead75d9ea55327dc6f778b16e7 /gtk2_ardour/ardour_ui.cc | |
parent | 570e002e867c207dc242dd11d926b277c9c8a54e (diff) |
fix crash at startup if .rc files are empty and/or if ARDOUR::init() fails for any reason; also avoid calling XML parser with empty files
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2907 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 8601b3f5e4..c7051680db 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -228,7 +228,10 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) /* lets get this party started */ try { - ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization); + if (ARDOUR::init (ARDOUR_COMMAND_LINE::use_vst, ARDOUR_COMMAND_LINE::try_hw_optimization)) { + throw failed_constructor (); + } + setup_gtk_ardour_enums (); Config->set_current_owner (ConfigVariableBase::Interface); setup_profile (); @@ -236,7 +239,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) } catch (failed_constructor& err) { error << _("could not initialize Ardour.") << endmsg; // pass it on up - throw err; + throw; } /* we like keyboards */ @@ -247,7 +250,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[]) stopping.connect (mem_fun(*this, &ARDOUR_UI::shutdown)); platform_setup (); - } int |