Use a QPointer for the m_mode member.
authorMohammed Sameer <msameer@foolab.org>
Sat, 6 Apr 2013 18:02:26 +0000 (21:02 +0300)
committerMohammed Sameer <msameer@foolab.org>
Fri, 2 Aug 2013 21:05:59 +0000 (00:05 +0300)
m_mode is owned by the device and it will be destroyed if device
gets destroyed.

declarative/mode.h

index f92869b..f8fb30b 100644 (file)
@@ -24,6 +24,7 @@
 #define MODE_H
 
 #include <QObject>
+#include <QPointer>
 
 class Camera;
 class QImage;
@@ -68,7 +69,7 @@ protected:
   virtual void changeMode() = 0;
 
   Camera *m_cam;
-  QtCamMode *m_mode;
+  QPointer<QtCamMode> m_mode;
 
 private:
   unsigned long long m_seq;