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

Add support for necessary events to be sent regardless of event dispatcher enabled state #1940

Merged
merged 2 commits into from
May 30, 2024

Conversation

rh101
Copy link
Contributor

@rh101 rh101 commented May 30, 2024

Describe your changes

If the event dispatcher is disabled, then necessary events such as EVENT_RENDERER_RECREATED, EVENT_APP_RESTARTING, EVENT_COME_TO_FOREGROUND, and EVENT_COME_TO_BACKGROUND will not be sent, which in certain instances will result in application crashes.

An example case:

1 - event dispatcher is disabled (such as on entering a scene transition)
2 - the app is moved to the background for any reason
3 - the app is then moved back to the foreground
4 - if the EGL context is lost, then it will attempt to recover/restart depending on the configuration (AX_ENABLE_CACHE_TEXTURE_DATA == 1 or AX_ENABLE_RESTART_APPLICATION_ON_CONTEXT_LOST == 1)
5 - since the event dispatcher is still disabled, EVENT_RENDERER_RECREATED (or EVENT_APP_RESTARTING) would never be sent out

Issue ticket number and link

Related issue: #1211

Checklist before requesting a review

For each PR

  • Add Copyright if it missed:
    - "Copyright (c) 2019-present Axmol Engine contributors (see AUTHORS.md)."

  • I have performed a self-review of my code.

    Optional:

    • I have checked readme and add important infos to this PR.
    • I have added/adapted some tests too.

For core/new feature PR

  • I have checked readme and add important infos to this PR.
  • I have added thorough tests.

@halx99 halx99 added this to the 2.1.4 milestone May 30, 2024
@halx99 halx99 added enhancement New feature or request bug Something isn't working labels May 30, 2024
@halx99 halx99 merged commit eee37e5 into axmolengine:dev May 30, 2024
15 checks passed
@rh101 rh101 deleted the event-dispatcher branch May 30, 2024 05:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants