Open tsujan opened 3 days ago
@palinek
This is a general question about QProcess
. Any thought on it?
Oh, it was added here 4 years ago, by @palinek: https://github.com/lxqt/qtermwidget/pull/171. Without it, this message is shown instead: QProcess: Destroyed while process ("/bin/bash") is still running.
Maybe another method needs to be found, because Konsole doesn't have this problem.
EDIT: Found a way by consulting Konsole's code.
The message of the title might happen repeatedly in the log (actually, each time a terminal window is closed) if I don't disable Qt warnings inside
~/.config/QtProject/qtlogging.ini
. It's caused by these lines in the d-tor ofKPtyProcess
:https://github.com/lxqt/qtermwidget/blob/df7297b3e372934cfa787cc3f92db9d18ec0e00b/lib/kptyprocess.cpp#L96-L104
Qt doc says that
QProcess::~QProcess()
will not return until the process is terminated.IMO, waiting for the
finished()
signal inside the d-tor of aQProcess
isn't OK. I checked KDE'skpty
→kptyprocess.cpp
. They either never usedwaitForFinished()
there or removed it a long time ago. ~Will use QTerminal without it for a while to test…~