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,9 +239,12 @@ class MainActivity : SimpleActivity(), DirectoryOperationsListener {
config.tempSkipDeleteConfirmation = false
mTempShowHiddenHandler.removeCallbacksAndMessages(null)
removeTempFolder()
if (!config.showAll) {
GalleryDatabase.destroyInstance()
}
}
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
if (mIsThirdPartyIntent) {

View file

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