mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-29 11:15:51 +00:00
Conditionally clear
This commit is contained in:
parent
cc78e3e255
commit
fb9b0a1c42
1 changed files with 12 additions and 11 deletions
|
@ -766,19 +766,20 @@ abstract class ActivityBase extends AppCompatActivity implements SharedPreferenc
|
||||||
@Override
|
@Override
|
||||||
public void onFragmentDestroyed(@NonNull FragmentManager fm, @NonNull Fragment f) {
|
public void onFragmentDestroyed(@NonNull FragmentManager fm, @NonNull Fragment f) {
|
||||||
log(fm, f, "onFragmentDestroyed");
|
log(fm, f, "onFragmentDestroyed");
|
||||||
try {
|
if (!BuildConfig.PLAY_STORE_RELEASE)
|
||||||
for (Field field : f.getClass().getDeclaredFields()) {
|
try {
|
||||||
Class<?> type = field.getType();
|
for (Field field : f.getClass().getDeclaredFields()) {
|
||||||
if (View.class.isAssignableFrom(type) ||
|
Class<?> type = field.getType();
|
||||||
RecyclerView.Adapter.class.isAssignableFrom(type)) {
|
if (View.class.isAssignableFrom(type) ||
|
||||||
Log.i("Clearing " + f.getClass().getSimpleName() + ":" + field.getName());
|
RecyclerView.Adapter.class.isAssignableFrom(type)) {
|
||||||
field.setAccessible(true);
|
Log.i("Clearing " + f.getClass().getSimpleName() + ":" + field.getName());
|
||||||
field.set(f, null);
|
field.setAccessible(true);
|
||||||
|
field.set(f, null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.w(ex);
|
||||||
}
|
}
|
||||||
} catch (Throwable ex) {
|
|
||||||
Log.w(ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue