diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt index 0b41a17d6..b29066036 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/pro/databases/GalleryDatabase.kt @@ -44,6 +44,11 @@ abstract class GalleryDatabase : RoomDatabase() { } fun destroyInstance() { + if (db != null) { + if(db!!.isOpen) { + db?.close(); + } + } db = null }