Skip to content

GameActivity backend should track lifetime of *mut android_app pointer more-carefully #235

Closed

Description

@rib

The same issues with tracking the *mut ANativeActivity pointer lifetime in the native-activity backend (#234) also apply to how the game-activity backend currently tracks the *mut android_app state pointer.

The current implementation works OK if it's generally assumed that an application exits before or immediately-after receiving a MainEvent::Destroy event, but if an application were to retain an AndroidApp after the activity has been destroyed and then try to query state from the activity then that would currently result in a use-after-free when the backend dereferences the *mut android_app pointer after it has been freed.

Activity

  1. added
    bugSomething isn't working
    safetySomething that relates to a safety or soundness issue
    on Mar 17, 2026
  2. added 2 commits that reference this issue on Mar 18, 2026
    b5ff3f5
    d0779cc
  3. added a commit that references this issue on Mar 19, 2026
    9163368
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsafetySomething that relates to a safety or soundness issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions