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
Document ?self parameter disownment #408
Comments
Yes, indeed! This should be documented much better, it's a subtle point. The Just so I have a bit more background, what were you attempting to do, and which bugs did you encounter? I will certainly add documentation, and knowing this will help me determine the best thing to write. |
I wasn’t doing anything very fancy at all… you can find the code in Kleidukos/ghcup-gtk#7. My problem was simply that I (and others) thought that the (My specific problem was that I needed to set up one event handler from within another, and didn’t realise that using the outer handler’s |
So far we were marking it as transient, but this is not necessary, and leads to subtle problems, see #408
So far we were marking it as transient, but this is not necessary, and leads to subtle problems, see #408
Could you please try What I did is get rid of the |
Just checked, and it does indeed seem to be fixed now, thanks! |
Great, thanks for checking! |
While implementing Kleidukos/ghcup-gtk#7, I discovered that the
?self
implicit parameter is disowned as soon as the event callback finishes (since it’s implemented usingwithTransient
). As far as I can tell, this is not documented anywhere, even though accidentally using?self
later can easily result in nasty bugs. It would be nice to document this behaviour, though I’m not sure where the best place to do so would be.The text was updated successfully, but these errors were encountered: