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

Destroy UI texture immediately to solve race condition #1516

Merged
merged 3 commits into from
Apr 8, 2022

Conversation

krzychu124
Copy link
Member

@krzychu124 krzychu124 commented Apr 4, 2022

Closes #1514

It turned out that destroying of MainWindow is delayed - it destroys also the UI texture atlas because it is not needed anymore.
When new window is created within the same frame it finds the atlas texture that will be destroyed at the end of frame (so it will be null after a moment). The first render of new component (in the next frame) check if its atlas is not null - otherwise takes default atlas.

I added also a simple if condition to rebuild textures with translation only if really needed (language changed).

Build zip

@krzychu124 krzychu124 added confirmed Represents confirmed issue or bug UI User interface updates regression old bug comes back or a new bug introduced in code that used to work. TEST TEST version of the mod / workshop page labels Apr 4, 2022
@krzychu124 krzychu124 self-assigned this Apr 4, 2022
@originalfoo originalfoo added this to the 11.6.5.2 milestone Apr 4, 2022
Copy link
Contributor

@chameleon-tbn chameleon-tbn left a comment

Choose a reason for hiding this comment

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

Tested with a Player who Had that issue every time. Now fixed :)

Copy link
Member

@originalfoo originalfoo left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Also noticeably faster when changing features now that it's not unnecessarily loading textures :)

@originalfoo
Copy link
Member

merge?

@krzychu124 krzychu124 merged commit 82d73bb into master Apr 8, 2022
@krzychu124 krzychu124 deleted the bugfix/1514-texture-atlas-breaks-on-menu-rebuild branch April 8, 2022 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed Represents confirmed issue or bug regression old bug comes back or a new bug introduced in code that used to work. TEST TEST version of the mod / workshop page UI User interface updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Texture atlas breaks when changing option involving menu rebuild
4 participants