summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/qcam/main_window.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index 6fe36168..e0e5092e 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -284,7 +284,9 @@ void MainWindow::switchCamera()
*/
startStopAction_->setChecked(false);
- camera_->release();
+ if (camera_)
+ camera_->release();
+
camera_ = cam;
startStopAction_->setChecked(true);