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 #4260: Synchronize access to fileDialog.data file list #4279

Merged

Conversation

JordanGoulder
Copy link
Contributor

Description:

This change adds a RWMutex to synchronize access to the fileDialog.data file list.
The refreshDir function clears and rebuilds fileDialog.data, meanwhile, several other functions are indexing into it.
This allowed for scenarios where fileDialog.data was either nil or smaller than expected when indexing into it.

Fixes #4260

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Thanks. I just left one simple comment inline :)

dialog/file.go Outdated Show resolved Hide resolved
dialog/file.go Outdated Show resolved Hide resolved
@coveralls
Copy link

coveralls commented Sep 24, 2023

Coverage Status

coverage: 65.24% (-0.006%) from 65.246% when pulling b1f6aff on JordanGoulder:fix_crash_on_filedialog_fast_click into 7593bdf on fyne-io:develop.

Jacalz
Jacalz previously approved these changes Sep 27, 2023
Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Thanks. I am happy with this but would like someone with better knowledge of mutexes to have a look first :)

@Jacalz Jacalz requested a review from Bluebugs September 27, 2023 13:21
dialog/file.go Outdated Show resolved Hide resolved
@Jacalz
Copy link
Member

Jacalz commented Sep 28, 2023

We've had some problems with some strange test failures in our CI workflow lately. I'll rerun and try to merge as soon as I can :)

@Jacalz Jacalz merged commit f17ccd8 into fyne-io:develop Sep 28, 2023
@JordanGoulder
Copy link
Contributor Author

Thanks for all the reviews!

@Jacalz
Copy link
Member

Jacalz commented Sep 28, 2023

Thank you for your work. It is much appreciated :)

@JordanGoulder JordanGoulder deleted the fix_crash_on_filedialog_fast_click branch October 3, 2023 00:15
andydotxyz pushed a commit that referenced this pull request Oct 4, 2023
This change adds a RWMutex to synchronize access to the fileDialog.data file list.
The refreshDir function clears and rebuilds fileDialog.data, meanwhile, several other functions are indexing into it.
This allowed for scenarios where fileDialog.data was either nil or smaller than expected when indexing into it.

Fixes #4260
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.

4 participants