diff --git a/libraries/AP_Scripting/AP_Scripting.cpp b/libraries/AP_Scripting/AP_Scripting.cpp index df09b53c5e..d9ba4f4436 100644 --- a/libraries/AP_Scripting/AP_Scripting.cpp +++ b/libraries/AP_Scripting/AP_Scripting.cpp @@ -235,6 +235,7 @@ void AP_Scripting::thread(void) { gcs().send_text(MAV_SEVERITY_CRITICAL, "Scripting: %s", "stopped"); } delete lua; + lua = nullptr; // clear allocated i2c devices for (uint8_t i=0; i