Skip to content

Ticker: add dtor implementation #5217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions drivers/Ticker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

namespace mbed {

void Ticker::~Ticker() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably call detach to ensure no more interrupts can fire.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

detach();
}

void Ticker::detach() {
core_util_critical_section_enter();
remove();
Expand Down
1 change: 1 addition & 0 deletions drivers/Ticker.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class Ticker : public TimerEvent, private NonCopyable<Ticker> {
#endif
}

~Ticker();
/** Attach a function to be called by the Ticker, specifying the interval in seconds
*
* @param func pointer to the function to be called
Expand Down