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

InputManager. mLateInitContext leak in Android U #2475

Closed
pyricau opened this issue Feb 9, 2023 · 0 comments · Fixed by #2514
Closed

InputManager. mLateInitContext leak in Android U #2475

pyricau opened this issue Feb 9, 2023 · 0 comments · Fixed by #2514
Milestone

Comments

@pyricau
Copy link
Member

pyricau commented Feb 9, 2023

This leak was caught by the leak detection code that runs as part of the Android X test suite, yay!

LeakTrace information

Signature: 10c1a5aa4b18fa45418c2fd92d175e4813f38d80
┬───
│ GC Root: System class
│
├─ android.hardware.input.InputManager class
│    Leaking: NO (a class is never leaking)
│    ↓ static InputManager.sInstance
│                          ~~~~~~~~~
├─ android.hardware.input.InputManager instance
│    Leaking: UNKNOWN
│    Retaining 338.2 kB in 2514 objects
│    mLateInitContext instance of android.app.ContextImpl
│    ↓ InputManager.mLateInitContext
│                   ~~~~~~~~~~~~~~~~
├─ android.app.ContextImpl instance
│    Leaking: YES (ContextImpl.mOuterContext is an instance of androidx.fragment.app.ActivityLeakActivity with Activity.mDestroyed true)
│    Retaining 337.7 kB in 2497 objects
│    mOuterContext instance of androidx.fragment.app.ActivityLeakActivity with mDestroyed = true
│    ↓ ContextImpl.mOuterContext
╰→ androidx.fragment.app.ActivityLeakActivity instance
     Leaking: YES (ObjectWatcher was watching this because androidx.fragment.app.ActivityLeakActivity received Activity#onDestroy() callback and Activity#mDestroyed is true)
     Retaining 318.1 kB in 2293 objects
     key = 90cc2df3-0fea-4de0-b489-4296552a8606
     watchDurationMillis = 5276
     retainedDurationMillis = 271
     mApplication instance of androidx.fragment.app.LeakCanaryApp
     mBase instance of android.app.ContextImpl

We should add InputManager.mLateInitContext as a known leak pattern if this doesn't get fixed in the preview that ships.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant