Skip to content

Webimage setImage race condition #130

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

Merged
merged 3 commits into from
Feb 28, 2022

Conversation

anderoonies
Copy link
Contributor

@anderoonies anderoonies commented Feb 24, 2022

Resolves #130

Summary

This fixes a bug that could arise when a WebImage had an outstanding onload callback that hadn't yet resolved and setImage was called again. The existing onload could resolve at a time when there was invalid image data. This resolves that by removing any existing onload handlers.

Changes:

  • Explicitly remove any existing onload callbacks when setting the image with setImage
  • Tests

Screenshots of the change:

Checklist

  • npm test passes
  • Unit tests are included / updated
  • Documentation has been updated where relevant

@anderoonies anderoonies changed the title Webimage setImage timing Webimage setImage race condition Feb 24, 2022
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.

1 participant