Skip to content

Commit 0668bca

Browse files

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed
 

‎src/core/qgsrunprocess.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,15 @@ void QgsRunProcess::dialogGone()
126126
// The dialog has gone, so the user is no longer interested in the
127127
// output from the process. Since the process will run happily
128128
// without the QProcess object, this instance and its data can then
129-
// go too.
129+
// go too, but disconnect the signals to prevent further functions in this
130+
// class being called after it has been deleted (Qt seems not to be
131+
// disconnecting them itself)
132+
133+
disconnect(mProcess, SIGNAL(error(QProcess::ProcessError)), this, SLOT(processError(QProcess::ProcessError)));
134+
disconnect(mProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(stdoutAvailable()));
135+
disconnect(mProcess, SIGNAL(readyReadStandardError()), this, SLOT(stderrAvailable()));
136+
disconnect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), this, SLOT(processExit(int,QProcess::ExitStatus)));
137+
130138
die();
131139
}
132140

0 commit comments

Comments
 (0)
Please sign in to comment.