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

Fix save style api, crash when saving styles #46955

Merged
merged 12 commits into from
Jan 24, 2022

Conversation

nyalldawson
Copy link
Collaborator

This PR reworks the API for saving styles to database to remove the unsafe use of widgets (a confirmation QMessageBox) from the provider code. This was shown when a matching style already exists in the database, and causes a crash if this method is ever called from a non-main thread.

Now determining if a matching style already exists is a separate method, and the messagebox questions are only present in the client (app) code.

Fixes #46954
Fixes #46914

@nyalldawson nyalldawson added API API improvement only, no visible user interface changes Crash/Data Corruption labels Jan 24, 2022
@github-actions github-actions bot added this to the 3.24.0 milestone Jan 24, 2022
Copy link
Contributor

@nirvn nirvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, glad you're able to address this prior to 3.24 release. Just a couple of suggestions here and there.

src/app/qgisapp.cpp Outdated Show resolved Hide resolved
src/gui/qgsmaplayerstylemanagerwidget.cpp Outdated Show resolved Hide resolved
src/providers/postgres/qgspostgresprovider.cpp Outdated Show resolved Hide resolved
@nyalldawson nyalldawson enabled auto-merge (rebase) January 24, 2022 05:58
@nyalldawson nyalldawson merged commit 5cdd5b5 into qgis:master Jan 24, 2022
@nyalldawson nyalldawson deleted the fix_save_style_api branch February 2, 2022 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API API improvement only, no visible user interface changes Crash/Data Corruption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Save layer style API is not thread safe New extract labels algorithm crashes under windows
2 participants