From 6995682610ef63088d925983ee5b3a3168e5947c Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 1 Oct 2021 16:58:33 +0200 Subject: [PATCH] Enable cleaning for Play store version --- .../java/eu/faircode/email/ActivityBase.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivityBase.java b/app/src/main/java/eu/faircode/email/ActivityBase.java index e282905859..7e127ce99d 100644 --- a/app/src/main/java/eu/faircode/email/ActivityBase.java +++ b/app/src/main/java/eu/faircode/email/ActivityBase.java @@ -766,20 +766,19 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc @Override public void onFragmentDestroyed(@NonNull FragmentManager fm, @NonNull Fragment f) { log(fm, f, "onFragmentDestroyed"); - if (!BuildConfig.PLAY_STORE_RELEASE) - try { - for (Field field : f.getClass().getDeclaredFields()) { - Class type = field.getType(); - if (View.class.isAssignableFrom(type) || - RecyclerView.Adapter.class.isAssignableFrom(type)) { - Log.i("Clearing " + f.getClass().getSimpleName() + ":" + field.getName()); - field.setAccessible(true); - field.set(f, null); - } + try { + for (Field field : f.getClass().getDeclaredFields()) { + Class type = field.getType(); + if (View.class.isAssignableFrom(type) || + RecyclerView.Adapter.class.isAssignableFrom(type)) { + Log.i("Clearing " + f.getClass().getSimpleName() + ":" + field.getName()); + field.setAccessible(true); + field.set(f, null); } - } catch (Throwable ex) { - Log.w(ex); } + } catch (Throwable ex) { + Log.w(ex); + } } @Override