Implementing 'connect" crashes the application
-
The attached code compiles / runs and passes both waitForStarted() and waitForReadyRead().
Then executes ( writes output) of readAllStandardOutput().
Adding "connect" crashes the app .
Is there another error I should be getting to help me to identify / specify why it crashes ?
processTERMINAL->start(exec,params); if(processTERMINAL->waitForStarted()) { qDebug() << " processTERMINAL->waitForStarted() OK"; qDebug() << "readAllStandardError()" << processTERMINAL->readAllStandardError(); qDebug() << "readAllStandardOutput()" << processTERMINAL->readAllStandardOutput(); } if(processTERMINAL->waitForReadyRead()) { qDebug() << " processTERMINAL->waitForReadyRead() OK"; qDebug() << "readAllStandardError()" << processTERMINAL->readAllStandardError(); qDebug() << "readAllStandardOutput()" << processTERMINAL->readAllStandardOutput(); #ifdef BYPASS // connect could be done in constructor connect( processTERMINAL, SIGNAL(readyReadStandardOutput()), this, SLOT(readFromStdout()) ); #endif } -
Code looks OK (apart from using old connect syntax). I think it would be best if you run the app with debugger attached, it will show you exactly where the crash occurs and also give you full application state at the time - allowing you to see if maybe there is some uninitialized object, dangling pointer etc. that is causing the crash.