|
From: Tapio V. <aa...@us...> - 2010-05-09 21:55:17
|
Module: performous
Branch: opencv
Commit: 20d97b7c8222752ea8128258c2efad19d54d0779
Author: Tapio Vierros <tap...@gm...>
Date: Sun May 9 23:33:06 2010 +0300
Fix crash when trying to join NULL thread in ~Webcam.
---
game/webcam.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/webcam.cc b/game/webcam.cc
index e9877df..8409225 100644
--- a/game/webcam.cc
+++ b/game/webcam.cc
@@ -4,7 +4,7 @@
#include "xtime.hh"
Webcam::Webcam(int cam_id):
- m_capture(NULL), m_frameAvailable(false), m_running(false), m_quit(false)
+ m_thread(), m_capture(NULL), m_frameAvailable(false), m_running(false), m_quit(false)
{
#ifdef USE_OPENCV
m_capture = cvCaptureFromCAM(cam_id);
@@ -21,7 +21,7 @@ Webcam::Webcam(int cam_id):
Webcam::~Webcam() {
m_quit = true;
#ifdef USE_OPENCV
- m_thread->join();
+ if (m_thread) m_thread->join();
cvReleaseCapture(&m_capture);
#endif
}
|