Skip to content

Fix #1080: prevent crash when removing source during size recalculation#2435

Open
ebuzerdrmz44 wants to merge 1 commit intoborgbase:masterfrom
ebuzerdrmz44:fix/source-tab-crash-on-remove-1080
Open

Fix #1080: prevent crash when removing source during size recalculation#2435
ebuzerdrmz44 wants to merge 1 commit intoborgbase:masterfrom
ebuzerdrmz44:fix/source-tab-crash-on-remove-1080

Conversation

@ebuzerdrmz44
Copy link
Contributor

Description

When a source is removed while its size is being recalculated, disconnect the
running thread's signal and add a DoesNotExist guard in set_path_info for cases
where the signal was already queued before disconnection.

Related Issue

#1080

Motivation and Context

Removing a source while its size is being recalculated causes the app to crash
with QThread: Destroyed while thread is still running. This happens because
the thread completes and tries to call set_path_info after the source has
already been deleted.

How Has This Been Tested?

Tested manually:

  1. Added a large folder in Source tab
  2. Clicked Recalculate
  3. Removed the source while calculating
  4. Without fix: app crashes with "QThread: Destroyed while thread is still running"
  5. With fix: app continues normally

Unit tests: 189 passed, 6 skipped, 0 failed.

Screenshots (if appropriate):

N/A

Types of changes

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

Checklist:

  • I have read the CONTRIBUTING guide.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Guard against race condition where FilePathInfoAsync thread completes
after the source has been removed. Disconnect thread signals on removal
and catch DoesNotExist in the callback as a safety net.
@ebuzerdrmz44 ebuzerdrmz44 changed the title fix: prevent crash when removing source during size recalculation Fix #1080: prevent crash when removing source during size recalculation Mar 15, 2026
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.

1 participant