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

[Leak] Toast$TN leaking in Android 11 #165

Open
KaustubhPatange opened this issue Feb 21, 2021 · 3 comments
Open

[Leak] Toast$TN leaking in Android 11 #165

KaustubhPatange opened this issue Feb 21, 2021 · 3 comments

Comments

@KaustubhPatange
Copy link

The leak is captured from LeakCanary.

┬───
│ GC Root: Global variable in native code
│
├─ android.widget.Toast$TN instance
│    Leaking: UNKNOWN
│    ↓ Toast$TN.mPresenter
│               ~~~~
├─ android.widget.ToastPresenter instance
│    Leaking: UNKNOWN
│    ↓ ToastPresenter.mContext
│                     ~~~~
╰→ com.kpstv.yts.ui.activities.FinalActivity instance
​     Leaking: YES (ObjectWatcher was watching this because com.kpstv.yts.ui.activities.FinalActivity received Activity#onDestroy() callback and Activity#mDestroyed is true)
​     key = c2fb5f4f-112b-4489-a84e-8b37699b32c1
​     watchDurationMillis = 6111
​     retainedDurationMillis = 1110

METADATA

Build.VERSION.SDK_INT: 30
Build.MANUFACTURER: samsung
LeakCanary version: 2.4
App process name: com.kpstv.yts
Analysis duration: 33287 ms

This happens when the toast is in the queue (referenced) but the activity or containing fragment (in which it's about to show) goes out of existence. I've tested in on some devices & found out that Samsung devices are hotspots for this leak.

The fix, for now, is to set allowQueue to false from Toasty.Config.

KaustubhPatange added a commit to KaustubhPatange/Moviesy that referenced this issue Feb 21, 2021
@wallyperry
Copy link

I also encountered this problem

@phamsarah
Copy link

Did you ever get this leak resolved? @KaustubhPatange

@pingatkaran
Copy link

Any updates on this Leak?

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

No branches or pull requests

4 participants