Fix: prevent crashes on closing a profile with dockable toolbars or mapper#7466
Merged
SlySven merged 1 commit intoMudlet:developmentfrom Oct 10, 2024
Conversation
…apper #### Brief overview of PR changes/additions Add some nullptr checks in some event handlers that use a `Host` pointer at a time when it may no longer be valid. #### Motivation for adding to Mudlet Somehow one of the profiles I used regularly has now started crashing on closing (not the whole application, just from closing the profile) and when I tried to `git bisect` it it still happened going back as far as Mudlet **4.16.0**. Given that I don't recall having this problem going back a couple of year I have to conclude something has changed in the way the underlying Qt libraries - I was testing throughout with Qt 5.16.8 on GNU/Linux. In all the cases I found that various events were being triggered but at the time their `Host` pointer was no longer valid - so the fix was to check that and abort their code from trying to de-reference it. #### Other info (issues closed, discussion etc) I did not check back before Mudlet 4.16.0 because at that point in its history it was crashing for unrelated reasons (trying to de-reference a `dlgTriggerEditor` pointer on profile closing which would have masked this problem AFAICT anyhow). Signed-off-by: Stephen Lyons <[email protected]>
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
vadi2
approved these changes
Oct 10, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief overview of PR changes/additions
Add some nullptr checks in some event handlers that use a
Hostpointer at a time when it may no longer be valid.Motivation for adding to Mudlet
Somehow one of the profiles I used regularly has now started crashing on closing (not the whole application, just from closing the profile) and when I tried to
git bisectit it still happened going back as far as Mudlet 4.16.0. Given that I don't recall having this problem going back a couple of year I have to conclude something has changed in the way the underlying Qt libraries operate - I was testing throughout with Qt 5.15.8 on GNU/Linux. In all the cases I found that various events were being triggered but at the time theirHostpointer was no longer valid - so the fix was to check that and abort their code from trying to de-reference it.Other info (issues closed, discussion etc)
I did not check back before Mudlet 4.16.0 because at that point in its history it was crashing for unrelated reasons (trying to de-reference a
dlgTriggerEditorpointer on profile closing which would have masked this problem AFAICT anyhow).