Skip to content

Commit

Permalink
refactor: add timeout for filejob thread
Browse files Browse the repository at this point in the history
When manipulating a file, if the TaskDialog has not been popped up yet, immediately close dde-file-manage at this time, here will cause the dde-file-manager process to be blocked in the main thread, and then can not open the new dde-file-manage process, so here to add a timeout time

Log: add timeout for filejob thread
  • Loading branch information
Johnson-zs authored and liyigang1 committed Oct 19, 2024
1 parent a6b823e commit 9893ab5
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,15 @@ AbstractJob::AbstractJob(AbstractWorker *doWorker, QObject *parent)
connect(doWorker, &AbstractWorker::fileRenamed, this, &AbstractJob::handleFileRenamed, Qt::QueuedConnection);
connect(qApp, &QCoreApplication::aboutToQuit, this, [=]() {
thread.quit();
thread.wait();
// When manipulating a file,
// if the TaskDialog has not been popped up yet,
// immediately close dde-file-manage at this time,
// here will cause the dde-file-manager process
// to be blocked in the main thread,
// and then can not open the new dde-file-manage process,
// so here to add a timeout time.
// see: bug-272373
thread.wait(3000);
});
start();
}
Expand Down

0 comments on commit 9893ab5

Please sign in to comment.