android / android/games-samples

Memory Leak on losing focus

Open
#53 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
307
Forks
138
Avg merge
8d 11h
Merged PRs (30d)
2

Description

https://github.com/android/games-samples/blob/32ff4ddc95617d8592c5859c23daccb3e92dd773/agdk/agdktunnel/app/src/main/cpp/native_engine.cpp#L460C29-L460C29

Every time your app loses focus, the savedState is reallocated and the pointer to the previous allocation is lost. savedState's memory is never deleted.

Contributor guide

Open the contributing guide

Research direction

Start at agdk/agdktunnel/app/src/main/cpp/native_engine.cpp around line 460 and inspect how savedState is allocated and managed when focus changes. Reproduce repeated focus loss in the AGDK Tunnel sample, then verify that savedState ownership is preserved and memory is released appropriately without changing the saved state behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev, mobile-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.