Skip to content

Fix a re-entrancy issue in the DiffView code#952

Merged
Murmele merged 2 commits into
Murmele:masterfrom
AHSauge:fix/diffview-crash
May 17, 2026
Merged

Fix a re-entrancy issue in the DiffView code#952
Murmele merged 2 commits into
Murmele:masterfrom
AHSauge:fix/diffview-crash

Conversation

@AHSauge
Copy link
Copy Markdown
Contributor

@AHSauge AHSauge commented Apr 30, 2026

Related to #944

It seems like dropping the QApplication::processEvents(); is the way to go here. That and queuing the callbacks seems to fix the problem. I'm not entirely sure if mFetching is even needed, but it's there just in case. I'm not sure what kind of side-effects this potentially could have.

@Murmele From the code, it looks like you added this at some point. Is there a concrete need to actually process events within fetchMore or is it acceptable post-pone the processing? To me it seems to work fine without the call at least, but maybe there's a corner case I'm not aware of here.

Fixes #946

Edit:
This also fixes #619 and #553

Comment thread src/ui/DiffView/DiffView.cpp
Comment thread src/ui/DiffView/DiffView.cpp Outdated
AHSauge added 2 commits May 15, 2026 15:24
fetchMore gets called multiple times. This queues the calls in the event loop rather than being directly executed
This also add a guard to get an early out.
Lastly, we drop processing events within fetchMore since there's no indication that this call is actually needed.
@AHSauge AHSauge force-pushed the fix/diffview-crash branch from 0eceebd to 6929fd5 Compare May 15, 2026 13:24
@Murmele Murmele merged commit f6f3139 into Murmele:master May 17, 2026
6 checks passed
@AHSauge AHSauge deleted the fix/diffview-crash branch May 18, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fast commits navigation using arrow keys makes app crash Segmentation fault when scrolling fast with the down key

2 participants