stop the device and delete it when we are being destroyed to avoid accessing it if...
authorMohammed Sameer <msameer@foolab.org>
Thu, 27 Sep 2012 22:29:05 +0000 (01:29 +0300)
committerMohammed Sameer <msameer@foolab.org>
Thu, 27 Sep 2012 22:29:05 +0000 (01:29 +0300)
imports/camera.cpp

index 14b1cf5..36f11ca 100644 (file)
@@ -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() {