From: Mohammed Sameer Date: Thu, 27 Sep 2012 22:29:05 +0000 (+0300) Subject: stop the device and delete it when we are being destroyed to avoid accessing it if... X-Git-Url: http://cgit.sxemacs.org/?a=commitdiff_plain;h=8d171a961f896d669b79660f3df011cb6161e395;p=harmattan%2Fcameraplus stop the device and delete it when we are being destroyed to avoid accessing it if a camerabin property changes --- diff --git a/imports/camera.cpp b/imports/camera.cpp index 14b1cf5..36f11ca 100644 --- a/imports/camera.cpp +++ b/imports/camera.cpp @@ -44,7 +44,14 @@ Camera::Camera(QDeclarativeItem *parent) : } Camera::~Camera() { - // TODO: + if (m_dev) { + // TODO: stop properly + m_dev->stop(); + m_dev->deleteLater(); + m_dev = 0; + } + + // TODO: cleanup } void Camera::componentComplete() {