musredit_qt5: replaced QProcess::startDetached by QProcess::start for musrT0 and musrFT due to issues with macOS 10.12. I will need to investigate the ownership issue a bit more careful since this fix might lead to a memory leak.
This commit is contained in:
parent
19d5c09b45
commit
87c8860ef7
@ -2259,9 +2259,22 @@ void PTextEdit::musrT0()
|
|||||||
str.setNum(fAdmin->getTimeout());
|
str.setNum(fAdmin->getTimeout());
|
||||||
arg << "--timeout" << str;
|
arg << "--timeout" << str;
|
||||||
|
|
||||||
QProcess proc(this);
|
QProcess *proc = new QProcess(this);
|
||||||
if (!proc.startDetached(cmd, arg, workDir)) {
|
|
||||||
QMessageBox::critical(this, "ERROR", "**ERROR** musrt0 process couldn't be launched properly, sorry.");
|
// make sure that the system environment variables are properly set
|
||||||
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
|
env.insert("LD_LIBRARY_PATH", env.value("ROOTSYS") + "/lib:" + env.value("LD_LIBRARY_PATH"));
|
||||||
|
proc->setProcessEnvironment(env);
|
||||||
|
proc->setWorkingDirectory(workDir);
|
||||||
|
proc->start(cmd, arg);
|
||||||
|
if (!proc->waitForStarted()) {
|
||||||
|
// error handling
|
||||||
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
|
QMessageBox::critical( 0,
|
||||||
|
tr("Fatal error"),
|
||||||
|
msg,
|
||||||
|
tr("Quit") );
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2282,11 +2295,23 @@ void PTextEdit::musrFT()
|
|||||||
|
|
||||||
if (dlg->exec() == QDialog::Accepted) {
|
if (dlg->exec() == QDialog::Accepted) {
|
||||||
fMusrFTPrevCmd = dlg->getMusrFTOptions();
|
fMusrFTPrevCmd = dlg->getMusrFTOptions();
|
||||||
QProcess proc(this);
|
QProcess *proc = new QProcess(this);
|
||||||
proc.setStandardOutputFile("musrFT.log");
|
proc->setStandardOutputFile("musrFT.log");
|
||||||
proc.setStandardErrorFile("musrFT.log");
|
proc->setStandardErrorFile("musrFT.log");
|
||||||
QString cmd = fAdmin->getExecPath() + "/musrFT";
|
QString cmd = fAdmin->getExecPath() + "/musrFT";
|
||||||
proc.startDetached(cmd, fMusrFTPrevCmd);
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
|
env.insert("LD_LIBRARY_PATH", env.value("ROOTSYS") + "/lib:" + env.value("LD_LIBRARY_PATH"));
|
||||||
|
proc->setProcessEnvironment(env);
|
||||||
|
proc->start(cmd, fMusrFTPrevCmd);
|
||||||
|
if (!proc->waitForStarted()) {
|
||||||
|
// error handling
|
||||||
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
|
QMessageBox::critical( 0,
|
||||||
|
tr("Fatal error"),
|
||||||
|
msg,
|
||||||
|
tr("Quit") );
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
delete dlg;
|
delete dlg;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user