From f1f20ccaae38499e01257623dde92507d2241a26 Mon Sep 17 00:00:00 2001 From: Antoine Bollengier <44288655+b5i@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:46:08 +0200 Subject: [PATCH 1/4] Fixed crash when closing an app that subscribed to system callbacks. --- lib/lua/src/lua_file.cpp | 7 +++++++ lib/lua/src/lua_file.hpp | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/lua/src/lua_file.cpp b/lib/lua/src/lua_file.cpp index 92545fd5..6b7656f8 100755 --- a/lib/lua/src/lua_file.cpp +++ b/lib/lua/src/lua_file.cpp @@ -57,6 +57,13 @@ LuaFile::LuaFile(storage::Path filename, storage::Path manifest) LuaFile::~LuaFile() { + // prevent a crash if the app is deleted and one or more callbacks are defined + this->onmessage = sol::nil; + this->onmessageerror = sol::nil; + this->oncall = sol::nil; + this->onlowbattery = sol::nil; + this->oncharging = sol::nil; + // libérer les ressources (events, etc) } diff --git a/lib/lua/src/lua_file.hpp b/lib/lua/src/lua_file.hpp index 3fa81a4f..0e4add80 100755 --- a/lib/lua/src/lua_file.hpp +++ b/lib/lua/src/lua_file.hpp @@ -65,13 +65,13 @@ class LuaFile void event_onmessageerror() { - if(onmessage.valid()) { + if(onmessageerror.valid()) { sol::protected_function_result result = onmessageerror(); if (!result.valid()) { sol::error err = result; - std::cout << "[LuaFile] onmessage event error: " << err.what() << std::endl; + std::cout << "[LuaFile] onmessageerror event error: " << err.what() << std::endl; } else { - std::cout << "onmessage event activated" << std::endl; + std::cout << "onmessageerror event activated" << std::endl; } } } From c686ee9270a9344ed0c71c13487734acbd6e6729 Mon Sep 17 00:00:00 2001 From: Antoine Bollengier <44288655+b5i@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:47:02 +0200 Subject: [PATCH 2/4] Fix disabled gui elements reacting to touch and appearing on screen. --- lib/gui/src/ElementBase.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gui/src/ElementBase.cpp b/lib/gui/src/ElementBase.cpp index 616bdb80..2fae4669 100644 --- a/lib/gui/src/ElementBase.cpp +++ b/lib/gui/src/ElementBase.cpp @@ -124,6 +124,9 @@ bool gui::ElementBase::updateAll() for (auto child : m_children) { + if (!child->getIsEnabled()) + continue; + if (child->updateAll()) { returnV = true; // if child had an event, ignore local events From 63ed9e2668785aa049e533f9c1e9385ab0d9f18e Mon Sep 17 00:00:00 2001 From: Antoine Bollengier <44288655+b5i@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:01:45 +0200 Subject: [PATCH 3/4] Fixed refresh bug when removing elements from list (GUI). --- lib/gui/src/ElementBase.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/gui/src/ElementBase.cpp b/lib/gui/src/ElementBase.cpp index 2fae4669..18d20112 100644 --- a/lib/gui/src/ElementBase.cpp +++ b/lib/gui/src/ElementBase.cpp @@ -39,6 +39,9 @@ gui::ElementBase::ElementBase() : m_x(0), m_y(0), gui::ElementBase::~ElementBase() { + if (m_parent != nullptr) + m_parent->localGraphicalUpdate(); + // Libération de la mémoire allouée pour les enfants de l'objet for (int i = 0; i < m_children.size(); i++) { From aa1d01a5aba22922606d20d7171e616080eb2360 Mon Sep 17 00:00:00 2001 From: pymuzard Date: Thu, 29 Aug 2024 12:17:39 +0200 Subject: [PATCH 4/4] correction compilation gsm - ajout codecvt --- lib/gsm/src/gsm.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/gsm/src/gsm.cpp b/lib/gsm/src/gsm.cpp index e3b23355..b46edb8c 100644 --- a/lib/gsm/src/gsm.cpp +++ b/lib/gsm/src/gsm.cpp @@ -7,6 +7,7 @@ #include #include #include "../../tasks/src/threads.hpp" +#include const char *daysOfWeek[7] = {"Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"}; const char *daysOfMonth[12] = {"Janvier", "Fevrier", "Mars", "Avril", "Mai", "Juin", "Juillet", "Aout", "Septembre", "Octobre", "Novembre", "Decembre"};