Two qprocess using the same variable
-
Hello,
Can anyone tell me why this code stops the first bash shell??
@int main(int argc, char* argv[]) {
QApplication app(argc, argv);
app.setApplicationName("QonsoleKeyEvents");
app.setOrganizationName("objectlearning.net");
QProcess* aProcess = new QProcess();
aProcess->start("bash", QStringList("-i"), QIODevice::ReadWrite);
aProcess = new QProcess();
aProcess->start("bash", QStringList("-i"), QIODevice::ReadWrite);
return app.exec();
}
@What would be the proper way to save references to multiple qprocess??
Thanks.
-
Hi,
What do you mean by "stops the first bash shell" ?
Use one variable per QProcess
You also have a double memory leak. You don't delete your two QProcess and you lose the address of the first.
-
How do you get this message ?
-
Are you sure that the Stopped is about the bash session started with QProcess ?
-
So if you consider this solved, could you update the thread title ?
Don't forget to clean your code of the memory leaks