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

source_remove warnings #10

Closed
wants to merge 1 commit into from
Closed

source_remove warnings #10

wants to merge 1 commit into from

Conversation

ayushnawal
Copy link
Contributor

Fixes #9

@quozl
Copy link
Contributor

quozl commented Jan 29, 2020

Yes, that will fix it.

Also needs GObject to GLib conversion of the timeout_add and source_remove functions.

It is unusual code and has another small fault; the turtle dance animation stutters because a new timeout is scheduled at the time the previous timeout is finishing. Each time there is a small delay, it grows. You'll see how the call to timeout_add happens inside the function. The function also does not explicitly return True or False as it should, instead just an ordinary return, which has the effect of False. It is more correct to use a repeating timeout, that way the function is more likely to be called some multiple of 250ms after the first call.

@ayushnawal
Copy link
Contributor Author

Thanks. already made a pull request for GObject to GLib with a flake8 pr.

It is unusual code and has another small fault; the turtle dance animation stutters because a new timeout is scheduled at the time the previous timeout is finishing. Each time there is a small delay, it grows. You'll see how the call to timeout_add happens inside the function. The function also does not explicitly return True or False as it should, instead just an ordinary return, which has the effect of False. It is more correct to use a repeating timeout, that way the function is more likely to be called some multiple of 250ms after the first call.

trying to fix the stuttering and delay, will update you

@quozl
Copy link
Contributor

quozl commented Jan 29, 2020

Reviewed 12b1960 again. It misses the mark. Another reason may be when _happy_turtle_dance returns early. Thus self._timeout_id would still be set but GLib would not have the event source registered.

@sourabhaa sourabhaa mentioned this pull request Aug 18, 2021
@chimosky
Copy link
Member

Closing as this has been fixed in 843e726.

@chimosky chimosky closed this Aug 19, 2021
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.

source_remove warnings
3 participants