-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
qgsdockablewidgethelper: Prevent crash when closing dock #59481
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
I don't think it's the correct fix either. The lambda is already referencing mDialog directly on line 319, so that means the only time that mDialog is nullptr on line 321 is if some connection to the closed signal emitted on line 320 has done something bad. My suspicion would be that the issue is in one of the connections to that closed signal. Where specifically did you see this crash? |
When closing a 2D canvas dock, QGIS sometimes crashes. This is because when the widget helper is closed, the canvas is closed. However, some signals of the canvas widget may still be called after it is called. Hence, the crash. This issue is fixed by calling `deleteLater()` instead of `delete` to ensure a proper deletion which properly takes into account the signals.
bb560cb
to
da73063
Compare
Thanks. To trigger the crash:
|
This should be the proper fix now. |
LGTM! thanks for the extra investigation ! |
Description
When closing the dock, QGIS sometimes crash. It seems like the
mDialog::finished
slot sendsvisibilityChanged
signal. However, theQgsDockableWidgetHelper
may have been destroyed in the meantime. Hence, the crash.I tried to solve this issue by ensuring to emit this signal if the object still exists. I cannot reproduce the issue anymore but I'm not sure this is the proper fix.