mirror of
https://github.com/SimpleMobileTools/Simple-Calendar.git
synced 2025-01-12 16:55:05 +01:00
destroy the DB instance on leaving the app
This commit is contained in:
parent
b532c7852e
commit
4ed323e60e
@ -19,6 +19,7 @@ import androidx.core.view.MenuItemCompat
|
||||
import com.simplemobiletools.calendar.pro.BuildConfig
|
||||
import com.simplemobiletools.calendar.pro.R
|
||||
import com.simplemobiletools.calendar.pro.adapters.EventListAdapter
|
||||
import com.simplemobiletools.calendar.pro.databases.EventsDatabase
|
||||
import com.simplemobiletools.calendar.pro.dialogs.ExportEventsDialog
|
||||
import com.simplemobiletools.calendar.pro.dialogs.FilterEventTypesDialog
|
||||
import com.simplemobiletools.calendar.pro.dialogs.ImportEventsDialog
|
||||
@ -149,6 +150,13 @@ class MainActivity : SimpleActivity(), RefreshRecyclerViewListener {
|
||||
closeSearch()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
if (!isChangingConfigurations) {
|
||||
EventsDatabase.destroyInstance()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreateOptionsMenu(menu: Menu): Boolean {
|
||||
menuInflater.inflate(R.menu.menu_main, menu)
|
||||
menu.apply {
|
||||
|
Loading…
Reference in New Issue
Block a user