-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Migrate to the new threading model more gently #5411
Comments
Linking this to the parent ticket as well #4654 |
So far I have a utility function that we can use appropriately: func EnsureMain(fn func()) {
if build.DisableThreadChecks || IsMainGoroutine() {
fn()
return
}
// logging code here too
fyne.Do(fn)
} And I propose log output along the lines of:
If this looks like a good start I can open a PR for that which will avoid a lot of crashes, then we can look at how it would be applied wider and also how to disable it for the project once people have ported over |
As noted in #5420, we need to wait with moving internal maps over because it will cause crashes for anyone with old code still updating elements in goroutines. |
The main points are all delivered now :) |
Checklist
Describe the bug
As pointed out by some of our testers, an app that has any amount of background processing will probably crash on basic usage when upgrading to v2.6.0.
How to reproduce
Run on
develop
and include in your app this minimal code:Screenshots
No response
Example code
Fyne version
v2.6.0-pre
Go compiler version
all
Operating system and version
macOS particularly, but many variants
Additional Information
Plan:
runOnMain
for window handling / OS impacting code we should have a thread check that will be removed later (Moving window handling functions into a safer transition mode #5415)Widget.Refresh()
for one)The text was updated successfully, but these errors were encountered: