From 7b6d0d7330b31c45c44bf52d3acdc6c1df9dddf3 Mon Sep 17 00:00:00 2001 From: philmoz Date: Wed, 2 Oct 2024 14:14:26 +1000 Subject: [PATCH] Fix shutdown crash. --- radio/src/edgetx.cpp | 4 ---- radio/src/lua/interface.cpp | 4 +++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/radio/src/edgetx.cpp b/radio/src/edgetx.cpp index 3ec8f0d07be..e65d5d857d6 100644 --- a/radio/src/edgetx.cpp +++ b/radio/src/edgetx.cpp @@ -1089,10 +1089,6 @@ void edgeTxClose(uint8_t shutdown) #endif } -#if defined(LUA) - luaClose(&lsScripts); -#endif - logsClose(); storageFlushCurrentModel(); diff --git a/radio/src/lua/interface.cpp b/radio/src/lua/interface.cpp index e7098e85255..9000d34dfab 100644 --- a/radio/src/lua/interface.cpp +++ b/radio/src/lua/interface.cpp @@ -278,10 +278,12 @@ void luaClose(lua_State ** L) void luaClose() { - luaClose(&lsScripts); #if defined(COLORLCD) luaClose(&lsWidgets); + extern lua_State* lsStandalone; + luaClose(&lsStandalone); #endif + luaClose(&lsScripts); } void luaRegisterLibraries(lua_State * L)