land_detector: cleanup subscriptions & publications

This commit is contained in:
Beat Küng
2018-09-28 15:21:19 +02:00
committed by Lorenz Meier
parent 0ac5f2cd8b
commit b69dd50d90

View File

@@ -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()