azhon / AppUpdate

Android App update library. Android版本更新库,简单、轻量、可随意定制
Apache License 2.0
2.32k stars 338 forks source link

内存泄漏问题 #116

Closed ZSFeng closed 2 years ago

ZSFeng commented 2 years ago

Bug标题 出现内存泄漏

复现步骤 在Home页面弹出更新,点击升级,提示在后台下载,然后切换到Login页面,关闭Home页面出现内存泄漏

错误Logcat日志截图 Screenshot_20220120-114424

ZSFeng commented 2 years ago

就是还在下载的过程中,关闭了依附的Activity,会出现内存泄漏,我现在的做法就在onDestory()里进行释放 if (downloadManager != null) {
if (downloadManager.getConfiguration().getHttpManager() != null) { downloadManager.getConfiguration().getHttpManager().cancel(); downloadManager.getConfiguration().getHttpManager().release(); } downloadManager.release(); stopService(new Intent(this, DownloadService.class)); NotificationUtil.cancelNotification(this); }

azhon commented 2 years ago

等我有时间看下怎么改😄

azhon commented 2 years ago

@ZSFeng 进下qq群:828385813,沟通一下

azhon commented 2 years ago

已在V3.0.7版本修复