-
-
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
Fix crash in label with binding #2131
Conversation
Moved to a different setup model where we don't recreate listeners all the time. Fixes fyne-io#2125
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I will try to explore the connected flag in other PR to see if it is viable :)
It seems that there is something more we have to do here, sometimes I got an error inside convert.go:
|
Those line numbers don't mat this PR... do you have local changes? |
Yes, but they are commented. I copied your changes and paste in a local branch. I will try to reproduce it, by cloning directly your branch, although I think it would be the same 🤔. I will investigate. However it seems that this PR is ok and this can be solved in a different one? |
Ok, I have tested your branch without any change, this is the error trace:
|
This is really weird, it seems that there is a chance that func (s *stringFromFloat) Get() (string, error) {
val, err := s.from.Get()
if err != nil {
return "", err
}
return fmt.Sprintf(s.format, val), nil
} I added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have found something interesting that I didn't know before (probably it was logical but I hadn't realized it). Nil objects can call its methods without actually crashing the whole program:
https://play.golang.org/p/tOzpRaZTt3m
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same change should be done on Unbind
method.
Moved to a different setup model where we don't recreate listeners all the time.
Fixes #2125
If this is a desirable change we could move other Bind/Unbind widget to match.
Checklist: