-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ReaderRolling: Guard against races between scheduled tasks and CloseDocument #10934
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
Conversation
(Ping @poire-z for when he gets back ;)). |
Easy enough to avoid here, so, dooooooo iiiiitttttt!
UIManager:scheduleIn(0.1, function () | ||
self:onCheckDomStyleCoherence() | ||
end) | ||
UIManager:scheduleIn(0.1, self.onCheckDomStyleCoherence, self) |
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 prefer the readability of the one with the function() wrapper - and for consistency with the others that may do just a bit more, like in your next chunk.
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.
It usually depends on my mood, but avoiding a closure here means we can easily unschedule it without storing a reference to the scheduled closure, so it's very much on purpose there (to get a simple, stable reference to the scheduled function).
(I'm not necessarily a fan of doing the guarding inside the closure like some of them do, for instance).
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.
Nothing against.
Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
Fix #10932
This change is