Initialize some uninitialized variables

This is only relevant when session load fails, by throwing
an error, which is caught and calls destroy() before
Session::setup_lua is called.
This commit is contained in:
Robin Gareus 2024-01-06 03:56:57 +01:00
parent 128278c75f
commit 986faf42f5
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -252,6 +252,13 @@ Session::Session (AudioEngine &eng,
, pending_auto_loop (false)
, _mempool ("Session", 3145728)
, lua (lua_newstate (&PBD::ReallocPool::lalloc, &_mempool))
, _lua_run (0)
, _lua_add (0)
, _lua_del (0)
, _lua_list (0)
, _lua_load (0)
, _lua_save (0)
, _lua_cleanup (0)
, _n_lua_scripts (0)
, _io_plugins (new IOPlugList)
, _butler (new Butler (*this))
@ -679,7 +686,9 @@ Session::destroy ()
{
/* unregister all lua functions, drop held references (if any) */
Glib::Threads::Mutex::Lock tm (lua_lock, Glib::Threads::TRY_LOCK);
(*_lua_cleanup)();
if (_lua_cleanup) {
(*_lua_cleanup)();
}
lua.do_command ("Session = nil");
delete _lua_run;
delete _lua_add;