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

Lazily initialize static bitmaps. #2543

Closed
wants to merge 2 commits into from

Conversation

player-03
Copy link
Contributor

@player-03 player-03 commented Mar 29, 2022

The web workers coming up in Lime 8.2.0 create a new static context on the background thread, initializing all static variables. Problem is, web workers aren't allowed to do I/O, so creating a bitmap causes an error. One solution is to lazily initialize these particular bitmaps.

All of OpenFL's other static variables work fine, as far as I'm aware.

I/O is forbidden in web workers, so creating a bitmap causes an error.

One solution is to put off creating the bitmaps until they're used,
which they typically aren't in a web worker.
@player-03
Copy link
Contributor Author

I took another look and found a better place to handle this: openfl/lime@166ac06.

@player-03 player-03 closed this May 27, 2024
@player-03 player-03 deleted the web_worker branch May 27, 2024 16:14
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.

None yet

1 participant