Skip to content

Commit 01e1c07

Browse files
committed
Ticker: add dtor implementation
Dtor should invoke detach
1 parent bb61b42 commit 01e1c07

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

drivers/Ticker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222

2323
namespace mbed {
2424

25+
void Ticker::~Ticker() {
26+
detach();
27+
}
28+
2529
void Ticker::detach() {
2630
core_util_critical_section_enter();
2731
remove();

drivers/Ticker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class Ticker : public TimerEvent, private NonCopyable<Ticker> {
7676
#endif
7777
}
7878

79+
~Ticker();
7980
/** Attach a function to be called by the Ticker, specifying the interval in seconds
8081
*
8182
* @param func pointer to the function to be called

0 commit comments

Comments
 (0)