Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix: prevent crashes on closing a profile with dockable toolbars or mapper#7466

Merged
SlySven merged 1 commit intoMudlet:developmentfrom
SlySven:Fix_preventCrashesOnClosingWithDockableToolbarsOrMapper
Oct 10, 2024
Merged

Fix: prevent crashes on closing a profile with dockable toolbars or mapper#7466
SlySven merged 1 commit intoMudlet:developmentfrom
SlySven:Fix_preventCrashesOnClosingWithDockableToolbarsOrMapper

Conversation

@SlySven
Copy link
Member

@SlySven SlySven commented Oct 9, 2024

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 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 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).

…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]>
@SlySven SlySven added the Hacktoberfest Code & win a T-shirt :) label Oct 9, 2024
@SlySven SlySven requested a review from a team as a code owner October 9, 2024 16:56
@add-deployment-links
Copy link

add-deployment-links bot commented Oct 9, 2024

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

No need to install anything - just unzip and run.
Let us know if it works well, and if it doesn't, please give details.

@SlySven SlySven merged commit 0dee998 into Mudlet:development Oct 10, 2024
@SlySven SlySven deleted the Fix_preventCrashesOnClosingWithDockableToolbarsOrMapper branch October 10, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hacktoberfest Code & win a T-shirt :)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants