From 03147665ce2a4b5eb4a14ce48c1ca4d5d6298d55 Mon Sep 17 00:00:00 2001 From: Ido Ben-Hur Date: Thu, 20 Oct 2022 13:20:09 +0300 Subject: [PATCH] OpenDelta: Do not leak service connection We bind using the old API so we should also unbind. bind onCreate so symmetricly unbind onDestroy --- src/eu/chainfire/opendelta/MainActivity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/eu/chainfire/opendelta/MainActivity.java b/src/eu/chainfire/opendelta/MainActivity.java index 135c5e5..379176e 100644 --- a/src/eu/chainfire/opendelta/MainActivity.java +++ b/src/eu/chainfire/opendelta/MainActivity.java @@ -751,6 +751,12 @@ public class MainActivity extends Activity { } } + @Override + public void onDestroy() { + unbindService(mConnection); + super.onDestroy(); + } + private boolean isExternalStorageDocument(Uri uri) { return "com.android.externalstorage.documents".equals(uri.getAuthority()); }