From 7b0f74cc7e0c0c2a0c955f8770ee3e96e98ebaa3 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sat, 10 Sep 2022 17:22:08 +0100 Subject: [PATCH] AP_Scripting: clear alocated i2c devices on scripting stop --- libraries/AP_Scripting/AP_Scripting.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/AP_Scripting/AP_Scripting.cpp b/libraries/AP_Scripting/AP_Scripting.cpp index 85c2b6d864..df09b53c5e 100644 --- a/libraries/AP_Scripting/AP_Scripting.cpp +++ b/libraries/AP_Scripting/AP_Scripting.cpp @@ -236,6 +236,13 @@ void AP_Scripting::thread(void) { } delete lua; + // clear allocated i2c devices + for (uint8_t i=0; i