From b69dd50d904d45e42b94151c9f214b528895bf1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Fri, 28 Sep 2018 15:21:19 +0200 Subject: [PATCH] land_detector: cleanup subscriptions & publications --- src/modules/land_detector/LandDetector.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/modules/land_detector/LandDetector.cpp b/src/modules/land_detector/LandDetector.cpp index abbacf930b..08cb85bf8f 100644 --- a/src/modules/land_detector/LandDetector.cpp +++ b/src/modules/land_detector/LandDetector.cpp @@ -60,6 +60,18 @@ LandDetector::LandDetector() : LandDetector::~LandDetector() { perf_free(_cycle_perf); + + if (_armingSub >= 0) { + orb_unsubscribe(_armingSub); + } + + if (_parameterSub >= 0) { + orb_unsubscribe(_parameterSub); + } + + if (_landDetectedPub) { + orb_unadvertise(_landDetectedPub); + } } int LandDetector::start()