kdesudo: remove the temporary xauth file from KdeSudo destructor

regardless if error occurs

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-06-02 21:02:07 +03:00
parent 3736563787
commit 0156f73bef

View file

@ -284,6 +284,9 @@ KdeSudo::~KdeSudo()
m_process->terminate(); m_process->terminate();
m_process->waitForFinished(3000); m_process->waitForFinished(3000);
} }
if (!m_tmpName.isEmpty()) {
QFile::remove(m_tmpName);
}
} }
void KdeSudo::error(const QString &msg) void KdeSudo::error(const QString &msg)
@ -333,9 +336,6 @@ void KdeSudo::parseOutput()
void KdeSudo::procExited(int exitCode) void KdeSudo::procExited(int exitCode)
{ {
if (!m_error) { if (!m_error) {
if (!m_tmpName.isEmpty()) {
QFile::remove(m_tmpName);
}
KApplication::kApplication()->exit(exitCode); KApplication::kApplication()->exit(exitCode);
} }
} }