Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent race on applications quitting whilst save jobs are in process #223

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidedmundson
Copy link

If an application calls quit or closes all windows we still want to finish saving the password. Qt provides a mechanism to defer the exit whilst jobs are active.

This brings us in line with KDE's KJob.

Note this change can cause a niche behavioural change with QCoreApplication applications that incorrectly have with quit loop enabled and use the main event loop so should probably not be backported.

If an application calls quit or closes all windows we still want to
finish saving the password. Qt provides a mechanism to defer the exit
whilst jobs are active.

This brings us in line with KDE's KJob.

Note this change can cause a niche behavioural change with
QCoreApplication applications that incorrectly have with quit loop
enabled and use the main event loop so should probably not be
backported.
@frankosterfeld
Copy link
Owner

Wouldn't this break when using Qtkeychain jobs outside the main thread?

@davidedmundson
Copy link
Author

Good question.

It would hold a lock on the application. holding a lock on the app (QCoreApplicationPrivate::ref) is thread safe. It won't break.

But it doesn't protect the thread case, one could still kill a thread with an active job, though I would say that's the caller's responsibility?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants