square / leakcanary

A memory leak detection library for Android.
https://square.github.io/leakcanary
Apache License 2.0
29.31k stars 3.97k forks source link

Plumber fix for InputMethodManager.mNextServedView on Android 8 / API 26 #2261

Open pyricau opened 2 years ago

pyricau commented 2 years ago

Report:

┬───
│ GC Root: System class
│
├─ android.view.inputmethod.InputMethodManager class
│    Leaking: NO (InputMethodManager↓ is not leaking and a class is never leaking)
│    ↓ static InputMethodManager.sInstance
├─ android.view.inputmethod.InputMethodManager instance
│    Leaking: NO (InputMethodManager is a singleton)
│    Library leak match: instance field android.view.inputmethod.InputMethodManager#mNextServedView
│    ↓ InputMethodManager.mNextServedView
│                         ~~~~~~~~~~~~~~~
╰→ android.widget.LinearLayout instance
​     Leaking: YES (View.mContext references a destroyed activity)

Hprof: repro_lib_leak.hprof.zip

mServedView and mNextServedView point to the same view.

pyricau commented 2 years ago

Will be adressed in #2339

pyricau commented 1 year ago

PR was closed, lack of time to focus on this, but it's still very much something we can try to fix.