From a4c99225c02e719d7900a533b777fd682eb5bd5c Mon Sep 17 00:00:00 2001 From: Thomas Gubler Date: Sun, 3 Nov 2013 16:49:02 +0100 Subject: [PATCH 1/3] initialize _vel_dot and _STEdotErrLast --- src/lib/external_lgpl/tecs/tecs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/external_lgpl/tecs/tecs.h b/src/lib/external_lgpl/tecs/tecs.h index 4a98c8e974..f8f832ed76 100644 --- a/src/lib/external_lgpl/tecs/tecs.h +++ b/src/lib/external_lgpl/tecs/tecs.h @@ -54,7 +54,9 @@ public: _SPE_est(0.0f), _SKE_est(0.0f), _SPEdot(0.0f), - _SKEdot(0.0f) { + _SKEdot(0.0f), + _vel_dot(0.0f), + _STEdotErrLast(0.0f) { } From 98f5a77574fde4b2c41d28cc0d694f6ca250fba1 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 3 Nov 2013 17:52:27 +0100 Subject: [PATCH 2/3] Fix to cancel pending callbacks for closing ORB topics --- src/modules/uORB/uORB.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/uORB/uORB.cpp b/src/modules/uORB/uORB.cpp index 7abbf42aed..50e433ec3c 100644 --- a/src/modules/uORB/uORB.cpp +++ b/src/modules/uORB/uORB.cpp @@ -249,9 +249,10 @@ ORBDevNode::close(struct file *filp) } else { SubscriberData *sd = filp_to_sd(filp); - if (sd != nullptr) + if (sd != nullptr) { + hrt_cancel(&sd->update_call); delete sd; - } + } return CDev::close(filp); } From 4865814f92c4a085972e317204c37042b609fdf8 Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Sun, 3 Nov 2013 17:58:28 +0100 Subject: [PATCH 3/3] Fixed typo, added testing - previous corner case now cleanly prevented --- src/modules/uORB/uORB.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/uORB/uORB.cpp b/src/modules/uORB/uORB.cpp index 50e433ec3c..149b8f6d24 100644 --- a/src/modules/uORB/uORB.cpp +++ b/src/modules/uORB/uORB.cpp @@ -253,6 +253,7 @@ ORBDevNode::close(struct file *filp) hrt_cancel(&sd->update_call); delete sd; } + } return CDev::close(filp); }