summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libcamera/timer.h1
-rw-r--r--src/libcamera/timer.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/include/libcamera/timer.h b/include/libcamera/timer.h
index 97dcc01f..f082339b 100644
--- a/include/libcamera/timer.h
+++ b/include/libcamera/timer.h
@@ -17,6 +17,7 @@ class Timer
{
public:
Timer();
+ ~Timer();
void start(unsigned int msec);
void stop();
diff --git a/src/libcamera/timer.cpp b/src/libcamera/timer.cpp
index 1cce4508..0dcb4e76 100644
--- a/src/libcamera/timer.cpp
+++ b/src/libcamera/timer.cpp
@@ -43,6 +43,11 @@ Timer::Timer()
{
}
+Timer::~Timer()
+{
+ stop();
+}
+
/**
* \brief Start or restart the timer with a timeout of \a msec
* \param[in] msec The timer duration in milliseconds