diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index cf39ed7aceca..ed0cad417d62 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -70,8 +70,10 @@ MainWindow::MainWindow(CameraManager *cm, const OptionsParser::Options &options)
 
 	/* Open the camera and start capture. */
 	ret = openCamera();
-	if (ret < 0)
+	if (ret < 0) {
 		quit();
+		return;
+	}
 
 	startStopAction_->setChecked(true);
 }
