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

Fixes #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Fixes #21

wants to merge 3 commits into from

Conversation

JuiP
Copy link
Member

@JuiP JuiP commented Aug 10, 2020

  • Fix Warning: Source ID 108 was not found when attempting to remove it
  • Port from GObject to GLib

@quozl @chimosky @Saumya-Mishra9129 Kindly test, review and merge :)

…game

/usr/share/sugar/activities/story.activity/game.py:531: Warning: Source ID 108 was not found when attempting to remove it
  GObject.source_remove(self._timeout_id)
Copy link
Member

@Saumya-Mishra9129 Saumya-Mishra9129 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix Warning: Source ID 108 was not found when attempting to remove it

I wonder why I am not getting any such warning. 😕

@JuiP
Copy link
Member Author

JuiP commented Aug 10, 2020

Way to reproduce it -
Start the activity, type something in the text box, now click on new game button; wait till new set of images are displayed. I found the warning in the logs after this.

@quozl
Copy link
Contributor

quozl commented Aug 11, 2020

  • it is more correct to clear the timeout id after source_remove in _all_clear,
  • i'm not sure if all the rules of dealing with source ids are being followed; see for example _dance_step which creates a new source id without checking if the previous one is removed; almost as if a different variable name should be used for the separate timer.

@JuiP
Copy link
Member Author

JuiP commented Aug 11, 2020

@quozl Thanks! I hope c9e6923 fixes it :)

@quozl
Copy link
Contributor

quozl commented Aug 11, 2020

  • _autonext is called by both the GLib event-loop and by other code; an overload of semantics ... when it is called by autoplay are you sure it should clear the _timeout_id?
  • _dance_step is also called by both the GLib event-loop and by other code; an overload of semantics ... it does not clear the _timeout_id when the counter is not less than 10, yet by returning False (the default) the timeout will have been removed automatically,
  • it is not necessary to set _timeout_id to None immediately before a call to GLib.timeout_add that assigns the source ID ot the _timeout_id variable.

I remain concerned about the use of the same variable name for multiple timeouts.

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.

3 participants