From 8fe8d810e977e88b3ce22a2f4332527892457377 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 15 Nov 2022 11:27:31 +0100 Subject: [PATCH 1/2] only delete table if not nullptr --- src/fsfw/health/HealthHelper.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/fsfw/health/HealthHelper.cpp b/src/fsfw/health/HealthHelper.cpp index bf1a92d2..f6077ea1 100644 --- a/src/fsfw/health/HealthHelper.cpp +++ b/src/fsfw/health/HealthHelper.cpp @@ -5,7 +5,11 @@ HealthHelper::HealthHelper(HasHealthIF* owner, object_id_t objectId) : objectId(objectId), owner(owner) {} -HealthHelper::~HealthHelper() { healthTable->removeObject(objectId); } +HealthHelper::~HealthHelper() { + if (healthTable != nullptr) { + healthTable->removeObject(objectId); + } +} ReturnValue_t HealthHelper::handleHealthCommand(CommandMessage* message) { switch (message->getCommand()) { From f8c07ec9cf2589547f4a706f0651557a6a689943 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 15 Nov 2022 11:46:43 +0100 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c7ab45e..9545c63e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## Fixes +- Only delete health table entry in `HealthHelper` destructor if + health table was set. + PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/710/files - I2C Bugfixes: Do not keep iterator as member and fix some incorrect handling with the iterator. Also properly reset the reply size for successfull transfers and erroneous transfers. PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/700