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 crash while downloading favicon #7104

Merged
merged 1 commit into from
Nov 14, 2021
Merged

Fix crash while downloading favicon #7104

merged 1 commit into from
Nov 14, 2021

Conversation

ADD-SP
Copy link
Contributor

@ADD-SP ADD-SP commented Nov 2, 2021

Fixes #7103

When I'm debugging, I find that it always crashes on this line.

delete downloader;

So I modified the code.

for (auto*& downloader : m_activeDownloaders) {
     downloader->deleteLater();
     downloader = nullptr;
}

Then I compiled and tested on Windows and the program no longer crashes.

Screenshots

Testing strategy

Type of change

  • ✅ Bug fix (non-breaking change that fixes an issue)

@ADD-SP ADD-SP changed the title Fix crash while downloading Fix crash while downloading favicon Nov 2, 2021
@codecov-commenter
Copy link

codecov-commenter commented Nov 4, 2021

Codecov Report

Merging #7104 (88a5cd5) into develop (20db504) will decrease coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #7104      +/-   ##
===========================================
- Coverage    63.95%   63.95%   -0.00%     
===========================================
  Files          330      330              
  Lines        41764    41764              
===========================================
- Hits         26708    26706       -2     
- Misses       15056    15058       +2     
Impacted Files Coverage Δ
src/gui/IconDownloaderDialog.cpp 0.00% <0.00%> (ø)
src/core/Entry.cpp 83.68% <0.00%> (-0.21%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 20db504...88a5cd5. Read the comment docs.

Copy link
Member

@droidmonkey droidmonkey left a comment

Choose a reason for hiding this comment

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

You can do away with the *& and just keep the deleteLater call. Setting the pointer to nullptr is unnecessary due to the clearing of the list right after this loop.

@ADD-SP ADD-SP requested a review from droidmonkey November 10, 2021 04:03
@droidmonkey droidmonkey added this to the v2.7.0 milestone Nov 14, 2021
@droidmonkey droidmonkey merged commit e5065a0 into keepassxreboot:develop Nov 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crash while downloading favicon
3 participants