Fixed leaking base instance to the event listener

This commit is contained in:
Viktor De Pasquale 2019-04-14 12:29:07 +02:00
parent 36e4ccd800
commit 147264822c
2 changed files with 1 additions and 4 deletions

View File

@ -7,10 +7,6 @@ import timber.log.Timber
abstract class MagiskViewModel : LoadingViewModel(), Event.AutoListener { abstract class MagiskViewModel : LoadingViewModel(), Event.AutoListener {
init {
Event.register(this)
}
override fun onEvent(event: Int) = Timber.i("Event of $event was not handled") override fun onEvent(event: Int) = Timber.i("Event of $event was not handled")
override fun getListeningEvents(): IntArray = intArrayOf() override fun getListeningEvents(): IntArray = intArrayOf()

View File

@ -69,6 +69,7 @@ class HomeViewModel(
private val latest = resources.getString(R.string.latest_version) private val latest = resources.getString(R.string.latest_version)
init { init {
Event.register(this)
refresh() refresh()
} }