android – LeakCanary报告在InputMethodManager中泄漏

前端之家收集整理的这篇文章主要介绍了android – LeakCanary报告在InputMethodManager中泄漏前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图弄清楚我的应用程序中的泄漏,但我不确定这是来自.

LeakCanary告诉我,我可以忽略它.是对的吗?

01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * LEAK CAN BE IGNORED.
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * com.mypackage.ui.map.MapComponentFragment has leaked:
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * GC ROOT android.view.inputmethod.InputMethodManager$1.this$0 (anonymous class extends com.android.internal.view.IInputMethodClient$Stub)
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * references android.view.inputmethod.InputMethodManager.mCurRootView
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * references com.android.internal.policy.impl.PhoneWindow$DecorView.mContext
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * references com.mypackage.ui.MainActivity.mFragments
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * references android.app.FragmentManagerImpl.mAdded
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * references java.util.ArrayList.array
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * references array java.lang.Object[].[0]
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * leaks com.mypackage.ui.map.MapComponentFragment instance
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * Reference Key: 0790f013-1c87-4d5f-8c10-db277187e3ce
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * Device: samsung samsung SM-N910C treltexx
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * Android Version: 5.1.1 API: 22 LeakCanary: 1.4-SNAPSHOT 2714152
01-06 12:04:56.580 6935-9159/com.mypackage D/LeakCanary: * Durations: watch=5085ms,gc=149ms,heap dump=2562ms,analysis=10313ms

这个碎片引起了几次泄漏,但我修复了它们.这个我不能让它消失.

任何线索?

编辑

还有一件事,如果我想忽略它,这应该足够了吗?

.instanceField("android.view.inputmethod.InputMethodManager","mCurRootView")

但仍然出现在LeakCanary

显然这个漏洞在AndroidExcludeRef中,但仍在报告中.
https://github.com/square/leakcanary/issues/322

解决方法

是的,你可以忽略这个漏洞.

检查此问题的示例:https://github.com/square/leakcanary/issues/256

原文链接:https://www.f2er.com/android/315631.html

猜你在找的Android相关文章