From 846bdbadb55db9ccdb1a74cace77dc994f266aec Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Sat, 5 Jan 2013 20:06:55 +0200 Subject: [PATCH] Declarative Camera should deactivete active mode when destroyed before stopping the device. This will prevent losing the video being recorded when closing camera while recording --- declarative/camera.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/declarative/camera.cpp b/declarative/camera.cpp index 36815bd..3865e42 100644 --- a/declarative/camera.cpp +++ b/declarative/camera.cpp @@ -78,6 +78,10 @@ Camera::Camera(QDeclarativeItem *parent) : Camera::~Camera() { if (m_dev) { + if (m_dev->activeMode()) { + m_dev->activeMode()->deactivate(); + } + m_dev->stop(true); m_dev->deleteLater(); m_dev = 0; -- 2.34.1