From f1c8fe9e039d25eff2122fe915f17e84477427eb Mon Sep 17 00:00:00 2001 From: Carl Poole Date: Wed, 25 Nov 2020 11:57:32 -0600 Subject: [PATCH] fix(android): dont release calls that are manually saved, eg listeners/watchers (#3857) Co-authored-by: Dan Imhoff --- android/capacitor/src/main/java/com/getcapacitor/Bridge.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java index 03fc4ffbf0..bf2cb7f7ad 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java @@ -768,7 +768,7 @@ public void onRequestPermissionsResult(int requestCode, String[] permissions, in // handle permission requests by other methods on the plugin plugin.getInstance().onRequestPermissionsResult(savedPermissionCall, requestCode, permissions, grantResults); - if (!savedPermissionCall.isReleased()) { + if (!savedPermissionCall.isReleased() && !savedPermissionCall.isSaved()) { savedPermissionCall.release(this); } }