forked from qt-creator/qt-creator
TestOutputReader: Don't store test process
Test process may be deleted when reader is still alive. Change-Id: I534d5bcebc6040305c4d937174db9444f6633df8 Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -29,7 +29,6 @@ FilePath TestOutputReader::constructSourceFilePath(const FilePath &path, const Q
|
||||
TestOutputReader::TestOutputReader(const QFutureInterface<TestResult> &futureInterface,
|
||||
QtcProcess *testApplication, const FilePath &buildDirectory)
|
||||
: m_futureInterface(futureInterface)
|
||||
, m_testApplication(testApplication)
|
||||
, m_buildDir(buildDirectory)
|
||||
, m_id(testApplication ? testApplication->commandLine().executable().toUserOutput() : QString())
|
||||
{
|
||||
@@ -41,11 +40,11 @@ TestOutputReader::TestOutputReader(const QFutureInterface<TestResult> &futureInt
|
||||
return line;
|
||||
};
|
||||
|
||||
if (m_testApplication) {
|
||||
m_testApplication->setStdOutLineCallback([this, &chopLineBreak](const QString &line) {
|
||||
if (testApplication) {
|
||||
testApplication->setStdOutLineCallback([this, &chopLineBreak](const QString &line) {
|
||||
processStdOutput(chopLineBreak(line.toUtf8()));
|
||||
});
|
||||
m_testApplication->setStdErrLineCallback([this, &chopLineBreak](const QString &line) {
|
||||
testApplication->setStdErrLineCallback([this, &chopLineBreak](const QString &line) {
|
||||
processStdError(chopLineBreak(line.toUtf8()));
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user