summaryrefslogtreecommitdiff
path: root/src/cam/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cam/main.cpp')
-rw-r--r--src/cam/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index ec59e9ea..6761d638 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -107,22 +107,23 @@ int CamApp::init(int argc, char **argv)
std::cout << "Camera "
<< std::string(options_[OptCamera])
<< " not found" << std::endl;
- cm_->stop();
+ cleanup();
return -ENODEV;
}
if (camera_->acquire()) {
std::cout << "Failed to acquire camera" << std::endl;
- camera_.reset();
- cm_->stop();
+ cleanup();
return -EINVAL;
}
std::cout << "Using camera " << camera_->name() << std::endl;
ret = prepareConfig();
- if (ret)
+ if (ret) {
+ cleanup();
return ret;
+ }
}
if (options_.isSet(OptMonitor)) {