From 08b2e03a8ac4758e4973d7fd549026ebeb28ff29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>
Date: Sun, 30 Jun 2019 17:20:01 +0200
Subject: libcamera: timer: Stop timer when it is deleted
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If a timer is running while it's deleted it is still register with the
event dispatcher. This causes a segmentation fault when the timer
time-out and its signal is emitted. Fix this my stopping the timer when
it's deleted.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/libcamera/timer.h | 1 +
 1 file changed, 1 insertion(+)

(limited to 'include')

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();
-- 
cgit v1.2.1