From 2acbc1a02eb0e84b6c568bb18502b879cf672012 Mon Sep 17 00:00:00 2001 From: tibbi Date: Sun, 2 Jul 2017 08:52:31 +0200 Subject: [PATCH] add some activity checks at clearing Glide load --- .../com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt | 3 ++- .../com/simplemobiletools/gallery/adapters/MediaAdapter.kt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt index 646954bcf..d1845938e 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/adapters/DirectoryAdapter.kt @@ -455,7 +455,8 @@ class DirectoryAdapter(val activity: SimpleActivity, var dirs: MutableList, } fun stopLoad() { - Glide.with(activity).clear(view.medium_thumbnail) + if (!activity.isDestroyed) + Glide.with(activity).clear(view.medium_thumbnail) } }