From 1aca3e5b28319237e103467cb0a50ba522d29695 Mon Sep 17 00:00:00 2001 From: WG <410689330@163.com> Date: Thu, 28 Jan 2021 17:56:42 +0800 Subject: [PATCH] Update PermissionFragment.kt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix 内存泄露 --- .../java/com/lzf/easyfloat/permission/PermissionFragment.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/easyfloat/src/main/java/com/lzf/easyfloat/permission/PermissionFragment.kt b/easyfloat/src/main/java/com/lzf/easyfloat/permission/PermissionFragment.kt index 5b4a3e8..7494225 100644 --- a/easyfloat/src/main/java/com/lzf/easyfloat/permission/PermissionFragment.kt +++ b/easyfloat/src/main/java/com/lzf/easyfloat/permission/PermissionFragment.kt @@ -44,10 +44,11 @@ internal class PermissionFragment : Fragment() { Logger.i("PermissionFragment onActivityResult: $check") // 回调权限结果 onPermissionResult?.permissionResult(check) + onPermissionResult = null // 将Fragment移除 fragmentManager.beginTransaction().remove(this).commitAllowingStateLoss() }, 500) } } -} \ No newline at end of file +}