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

Break infinite update() loop in sidebar #789

Merged
merged 3 commits into from
Dec 31, 2021

Conversation

lmoureaux
Copy link
Contributor

Resulted from misuse of the Qt APIs. Use them more as intended.

Closes #782.

Test plan:

  • Start game
  • Check CPU usage (should be << 100%)
  • Check that the sidebar still updates correctly

Resulted from misuse of the Qt APIs. Use them more as intended.

Closes longturn#782.
@lmoureaux
Copy link
Contributor Author

Rebased for clang-format CI fix, no other change

@jwrober
Copy link
Collaborator

jwrober commented Dec 28, 2021

This is what I see with this patch.
image

@hugomflavio
Copy link
Contributor

I'm still getting >100% CPU usage as well

image

@lmoureaux
Copy link
Contributor Author

I can reproduce 100% CPU when a unit is selected. Going to fix this too.

I got a double free in sidebar.cpp:346, which is a protected
FREE(final_pixmap). Reset final_pixmap to zero every time it is deleted to
avoid this situation.
lmoureaux added a commit to lmoureaux/freeciv21 that referenced this pull request Dec 31, 2021
The time until next frame was repeatedly divided by 1000, resulting in 0 wait
at the end.

See longturn#782.
See longturn#789.
@lmoureaux
Copy link
Contributor Author

Fixed another source of high CPU usage

The time until next frame was repeatedly divided by 1000, resulting in 0 wait
at the end.

See longturn#782.
See longturn#789.
Copy link
Collaborator

@jwrober jwrober left a comment

Choose a reason for hiding this comment

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

Do get a short spurt of 100% when moving around the map, but that is expected.

@jwrober jwrober merged commit 80dfb5d into longturn:master Dec 31, 2021
@lmoureaux lmoureaux deleted the bugfix/infinite-loop branch January 1, 2022 01:37
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.

100% CPU usage
3 participants