# HG changeset patch # User Chris Cannam # Date 1572364782 0 # Node ID d2e8e9788cd49c2ccd02c1426ac810bbcebeb72a # Parent 604393795ee5f7b027312a7f59d687bf28291b46 More debug output, and fix crash after failed external-program alignment diff -r 604393795ee5 -r d2e8e9788cd4 framework/Align.cpp --- a/framework/Align.cpp Tue Oct 29 12:47:44 2019 +0000 +++ b/framework/Align.cpp Tue Oct 29 15:59:42 2019 +0000 @@ -525,6 +525,8 @@ other->setAlignment(alignmentModelId); QProcess *process = new QProcess; + process->setProcessChannelMode(QProcess::ForwardedErrorChannel); + QStringList args; args << refPath << otherPath; @@ -532,6 +534,14 @@ this, SLOT(alignmentProgramFinished(int, QProcess::ExitStatus))); m_pendingProcesses[process] = alignmentModelId; + + SVCERR << "Align::alignModelViaProgram: Starting program \"" + << program << "\" with args: "; + for (auto a: args) { + SVCERR << "\"" << a << "\" "; + } + SVCERR << endl; + process->start(program, args); bool success = process->waitForStarted(); @@ -539,14 +549,15 @@ if (!success) { SVCERR << "ERROR: Align::alignModelViaProgram: Program did not start" << endl; - error = "Alignment program could not be started"; + error = "Alignment program \"" + program + "\" could not be executed"; m_pendingProcesses.erase(process); other->setAlignment({}); ModelById::release(alignmentModelId); delete process; + } else { + doc->addNonDerivedModel(alignmentModelId); } - doc->addNonDerivedModel(alignmentModelId); return success; }