summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-01-18 13:41:10 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2016-01-18 13:41:10 +0100
commit8a73091e5d3a801c0f52add4c808af6950f7851e (patch)
treec3986a54a0a0bc7d2fd01e471c717928da5f6095
parente7baaea9d72d4b39d9f6ee4142d37ed2cbcd22fe (diff)
Fix debug output filters. Delete input/output engines on premature program error.
-rw-r--r--drumgizmo/drumgizmoc.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/drumgizmo/drumgizmoc.cc b/drumgizmo/drumgizmoc.cc
index d6fea9e..6eff3ca 100644
--- a/drumgizmo/drumgizmoc.cc
+++ b/drumgizmo/drumgizmoc.cc
@@ -122,8 +122,8 @@ int CliMain::run(int argc, char *argv[])
{
int c;
- const char *hugin_filter = "+all";
- unsigned int hugin_flags = HUG_FLAG_OUTPUT_TO_STDOUT;
+ std::string hugin_filter;
+ unsigned int hugin_flags = HUG_FLAG_DEFAULT;
std::string outputengine;
std::string inputengine;
@@ -215,13 +215,15 @@ int CliMain::run(int argc, char *argv[])
}
hug_status_t status = hug_init(hugin_flags,
- HUG_OPTION_FILTER, hugin_filter,
+ HUG_OPTION_FILTER, hugin_filter.c_str(),
HUG_OPTION_END);
if(status != HUG_STATUS_OK) {
printf("Error: %d\n", status);
return 1;
}
+ DEBUG(drumgizmo, "Debug enabled.");
+
if(inputengine == "") {
printf("Missing input engine\n");
return 1;
@@ -263,6 +265,7 @@ int CliMain::run(int argc, char *argv[])
if(outputengine == "") {
printf("Missing output engine\n");
+ delete ie;
return 1;
}
@@ -307,6 +310,8 @@ int CliMain::run(int argc, char *argv[])
if(kitfile != "") {
printf("Can only handle a single kitfile.\n");
printf(usage_str, argv[0]);
+ delete ie;
+ delete oe;
return 1;
}
kitfile = argv[optind++];
@@ -315,6 +320,8 @@ int CliMain::run(int argc, char *argv[])
} else {
printf("Missing kitfile.\n");
printf(usage_str, argv[0]);
+ delete ie;
+ delete oe;
return 1;
}
@@ -346,6 +353,8 @@ int CliMain::run(int argc, char *argv[])
if(!gizmo.init()) {
printf("Failed init engine.\n");
+ delete ie;
+ delete oe;
return 1;
}