fix the timing of destroying the Gallery Database

This commit is contained in:
tibbi 2018-11-19 11:32:07 +01:00
parent 0b8e958d01
commit 43852a8112
2 changed files with 6 additions and 1 deletions

View file

@ -239,7 +239,10 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
config.tempSkipDeleteConfirmation = false config.tempSkipDeleteConfirmation = false
mTempShowHiddenHandler.removeCallbacksAndMessages(null) mTempShowHiddenHandler.removeCallbacksAndMessages(null)
removeTempFolder() removeTempFolder()
GalleryDatabase.destroyInstance()
if (!config.showAll) {
GalleryDatabase.destroyInstance()
}
} }
} }

View file

@ -34,6 +34,7 @@ import com.simplemobiletools.commons.views.MyRecyclerView
import com.simplemobiletools.gallery.pro.R import com.simplemobiletools.gallery.pro.R
import com.simplemobiletools.gallery.pro.adapters.MediaAdapter import com.simplemobiletools.gallery.pro.adapters.MediaAdapter
import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask import com.simplemobiletools.gallery.pro.asynctasks.GetMediaAsynctask
import com.simplemobiletools.gallery.pro.databases.GalleryDatabase
import com.simplemobiletools.gallery.pro.dialogs.ChangeGroupingDialog import com.simplemobiletools.gallery.pro.dialogs.ChangeGroupingDialog
import com.simplemobiletools.gallery.pro.dialogs.ChangeSortingDialog import com.simplemobiletools.gallery.pro.dialogs.ChangeSortingDialog
import com.simplemobiletools.gallery.pro.dialogs.ExcludeFolderDialog import com.simplemobiletools.gallery.pro.dialogs.ExcludeFolderDialog
@ -192,6 +193,7 @@ class MediaActivity : SimpleActivity(), MediaOperationsListener {
if (config.showAll && !isChangingConfigurations) { if (config.showAll && !isChangingConfigurations) {
config.temporarilyShowHidden = false config.temporarilyShowHidden = false
config.tempSkipDeleteConfirmation = false config.tempSkipDeleteConfirmation = false
GalleryDatabase.destroyInstance()
} }
mTempShowHiddenHandler.removeCallbacksAndMessages(null) mTempShowHiddenHandler.removeCallbacksAndMessages(null)