Skip to content

Commit 9b833d5

Browse files
author
Alberto Milone
committed
src/daemon/XorgDisplayServer.cpp: wait for DisplayStopCommand to finish
Also make sure to free the memory allocated for DisplayCommand
1 parent 180b11b commit 9b833d5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/daemon/XorgDisplayServer.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,14 @@ namespace SDDM {
250250
qDebug() << "Running display stop script " << displayStopCommand;
251251
displayStopScript->start(displayStopCommand);
252252

253+
// wait for finished
254+
if (!displayStopScript->waitForFinished(5000))
255+
displayStopScript->kill();
256+
257+
// clean up the script process
258+
displayStopScript->deleteLater();
259+
displayStopScript = nullptr;
260+
253261
// clean up
254262
process->deleteLater();
255263
process = nullptr;
@@ -276,6 +284,9 @@ namespace SDDM {
276284
env.insert("SHELL", "/bin/sh");
277285
displayScript->setProcessEnvironment(env);
278286

287+
// delete displayScript on finish
288+
connect(displayScript, SIGNAL(finished(int,QProcess::ExitStatus)), displayScript, SLOT(deleteLater()));
289+
279290
// start display setup script
280291
qDebug() << "Running display setup script " << displayCommand;
281292
displayScript->start(displayCommand);

0 commit comments

Comments
 (0)