Isael Diaz / MicrobitUltrasound
Revision:
9:d153bcba081c
Parent:
8:12e6c5d3dc5f
Child:
10:9008f714df44
Child:
11:41b7e18b8e06
--- a/MicrobitUltrasound.cpp	Mon Aug 29 22:03:36 2016 +0200
+++ b/MicrobitUltrasound.cpp	Tue Aug 30 20:56:14 2016 +0200
@@ -64,6 +64,13 @@
   echo->rise(this, &MicroBitUlstrasound::onEchoFall);
 }
 
+/**
+  * Destructor for MicrobitUltrasound, where we deregister from the array of fiber components.
+  */
+MicrobitUltrasound::~MicrobitUltrasound()
+{
+    fiber_remove_idle_component(this);
+}
 
 /**
  * This member function manages the calculation of the timestamp of a pulse detected