diff options
author | Robin Gareus <robin@gareus.org> | 2017-08-19 01:05:18 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-08-19 01:06:44 +0200 |
commit | fb745cc5a882cd4e3a49ff1f565cb69a65575993 (patch) | |
tree | 90dfcfeffabe50c4bdbf889bf0249a901b8b9b93 /libs/ardour/session.cc | |
parent | 2a9bf034bb21eb684c75711c97f6f730397140ee (diff) |
Lua may call C++ functions with throw. Catch them
Diffstat (limited to 'libs/ardour/session.cc')
-rw-r--r-- | libs/ardour/session.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 324e235c72..785977dc75 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -5513,7 +5513,7 @@ Session::registered_lua_functions () if (!i.key ().isString ()) { assert(0); continue; } rv.push_back (i.key ().cast<std::string> ()); } - } catch (luabridge::LuaException const& e) { } + } catch (...) { } return rv; } @@ -5529,7 +5529,7 @@ Session::try_run_lua (pframes_t nframes) if (_n_lua_scripts == 0) return; Glib::Threads::Mutex::Lock tm (lua_lock, Glib::Threads::TRY_LOCK); if (tm.locked ()) { - try { (*_lua_run)(nframes); } catch (luabridge::LuaException const& e) { } + try { (*_lua_run)(nframes); } catch (...) { } lua.collect_garbage_step (); } } @@ -5661,7 +5661,12 @@ Session::setup_lua () _lua_cleanup = new luabridge::LuaRef(lua_sess["cleanup"]); } catch (luabridge::LuaException const& e) { fatal << string_compose (_("programming error: %1"), - X_("Failed to setup Lua interpreter")) + std::string ("Failed to setup session Lua interpreter") + e.what ()) + << endmsg; + abort(); /*NOTREACHED*/ + } catch (...) { + fatal << string_compose (_("programming error: %1"), + X_("Failed to setup session Lua interpreter")) << endmsg; abort(); /*NOTREACHED*/ } @@ -5688,6 +5693,11 @@ Session::scripts_changed () _n_lua_scripts = cnt; } catch (luabridge::LuaException const& e) { fatal << string_compose (_("programming error: %1"), + std::string ("Indexing Lua Session Scripts failed.") + e.what ()) + << endmsg; + abort(); /*NOTREACHED*/ + } catch (...) { + fatal << string_compose (_("programming error: %1"), X_("Indexing Lua Session Scripts failed.")) << endmsg; abort(); /*NOTREACHED*/ |