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

QgsLayoutAtlasWidget: Disconnect signals when layout RIP #29968

Merged
merged 4 commits into from May 28, 2019

Conversation

elpaso
Copy link
Contributor

@elpaso elpaso commented May 27, 2019

Fixes #29821

@elpaso elpaso requested a review from nyalldawson May 27, 2019 14:54
@nyalldawson nyalldawson added Bug Either a bug report, or a bug fix. Let's hope for the latter! and removed Bugfix labels May 27, 2019
@nyalldawson
Copy link
Collaborator

What's the actual cause here? Shouldn't QgsLayoutAtlasWidget be getting deleted along with the whole layout designer when the layout is deleted?

@elpaso
Copy link
Contributor Author

elpaso commented May 28, 2019

What's the actual cause here? Shouldn't QgsLayoutAtlasWidget be getting deleted along with the whole layout designer when the layout is deleted?

It should, but it doesn't, I hoped you knew why but let me dig further.

Before other signals can crash the application.

Fixes qgis#29821
This reverts commit 1626565.

Found a better way to delete the widget when designer
dialog is closed.
@elpaso
Copy link
Contributor Author

elpaso commented May 28, 2019

@nyalldawson I've spent quite some time on it and I've hopefully found an acceptable fix, the dialog was not immediately deleted on close and the signals connected to the QgsLayoutAtlasWidget elements could still fire on the already deleted layout.

A similar strategy has been previously used in app: https://github.com/qgis/QGIS/blob/master/src/app/qgisapp.cpp#L11617

@nyalldawson
Copy link
Collaborator

Ok, guess it's working if that other code hasn't caused issues!

@elpaso elpaso merged commit 4b35d85 into qgis:master May 28, 2019
@elpaso elpaso deleted the bugfix-gh29821-layout-crash-py branch May 28, 2019 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QgsProject.instance().clear() crashes QGIS when LayoutDesigner Window is open
2 participants