google android 漏洞报告,LeakCanary在我的Java Android应用程序中检测到漏洞-谷歌地图...

我对这个场景比较陌生,没有什么编程背景,因此如果我问一些愚蠢的问题,我会提前道歉。

我正在使用SupportMapFragment显示一个google地图。我这样做是为了防止onDestroyView()中出现泄漏,但是不知道这是对还是错?

@Override

protected void onDestroy() {

super.onDestroy();

mMap.clear();

mapView.onDestroy();

}

完整代码如下:

â GC Root: Local variable in native code

â

ââ com.google.maps.api.android.lib6.gmm6.vector.n instance

â Leaking: UNKNOWN

â Retaining 1391172 bytes in 9076 objects

â Thread name: 'RenderDrive'

â â n.e

â ~

ââ com.google.maps.api.android.lib6.gmm6.vector.p instance

â Leaking: UNKNOWN

â Retaining 1391005 bytes in 9073 objects

â â p.k

â ~

ââ com.google.maps.api.android.lib6.gmm6.api.ac instance

â Leaking: UNKNOWN

â Retaining 1390953 bytes in 9072 objects

â View not part of a window view hierarchy

â View.mAttachInfo is null (view detached)

â View.mWindowAttachCount = 1

â mContext instance of android.app.Application

â â ac.mParent

â ~~~~~~~

ââ android.widget.FrameLayout instance

â Leaking: UNKNOWN

â Retaining 405651 bytes in 5497 objects

â View not part of a window view hierarchy

â View.mAttachInfo is null (view detached)

â View.mWindowAttachCount = 1

â mContext instance of android.app.Application

â â FrameLayout.mParent

â ~~~~~~~

ââ com.google.android.gms.maps.MapView instance

â Leaking: YES (View.mContext references a destroyed activity)

â Retaining 403455 bytes in 5482 objects

â View not part of a window view hierarchy

â View.mAttachInfo is null (view detached)

â View.mID = R.id.mapsView

â View.mWindowAttachCount = 1

â mContext instance of com.app.trikojis.MainActivity with mDestroyed = true

â â MapView.mContext

â°â com.app.trikojis.MainActivity instance

â Leaking: YES (ObjectWatcher was watching this because com.app.trikojis.MainActivity received Activity#onDestroy()

â callback and Activity#mDestroyed is true)

â Retaining 60455 bytes in 956 objects

â key = f3613896-cce8-4aac-a73a-d4a79700c719

â watchDurationMillis = 56451

â retainedDurationMillis = 51448

â mApplication instance of android.app.Application

â mBase instance of androidx.appcompat.view.ContextThemeWrapper, not wrapping known Android context

METADATA

Build.VERSION.SDK_INT: 28

Build.MANUFACTURER: samsung

LeakCanary version: 2.5

App process name: com.app.trikojis

Stats: LruCache[maxSize=3000,hits=5749,misses=110455,hitRate=4%]

RandomAccess[bytes=5714581,reads=110455,travel=48839777691,range=35924253,size=41590935]

Analysis duration: 11845 ms```

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值