Fix secure screen option subscription memory leak
This commit is contained in:
@@ -15,6 +15,9 @@ abstract class BaseActivity : AppCompatActivity() {
|
||||
|
||||
val preferences: PreferencesHelper by injectLazy()
|
||||
|
||||
@Suppress("LeakingThis")
|
||||
private val secureActivityDelegate = SecureActivityDelegate(this)
|
||||
|
||||
private val darkTheme: Int by lazy {
|
||||
when (preferences.themeDark()) {
|
||||
Values.THEME_DARK_DEFAULT -> R.style.Theme_Tachiyomi_Dark
|
||||
@@ -43,12 +46,18 @@ abstract class BaseActivity : AppCompatActivity() {
|
||||
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
SecureActivityDelegate.onCreate(this)
|
||||
secureActivityDelegate.onCreate()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
SecureActivityDelegate.onResume(this)
|
||||
secureActivityDelegate.onResume()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
secureActivityDelegate.onDestroy()
|
||||
|
||||
super.onDestroy()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,9 @@ import nucleus.view.NucleusAppCompatActivity
|
||||
|
||||
abstract class BaseRxActivity<P : BasePresenter<*>> : NucleusAppCompatActivity<P>() {
|
||||
|
||||
@Suppress("LeakingThis")
|
||||
private val secureActivityDelegate = SecureActivityDelegate(this)
|
||||
|
||||
init {
|
||||
@Suppress("LeakingThis")
|
||||
LocaleHelper.updateConfiguration(this)
|
||||
@@ -16,12 +19,18 @@ abstract class BaseRxActivity<P : BasePresenter<*>> : NucleusAppCompatActivity<P
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
SecureActivityDelegate.onCreate(this)
|
||||
secureActivityDelegate.onCreate()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
|
||||
SecureActivityDelegate.onResume(this)
|
||||
secureActivityDelegate.onResume()
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
secureActivityDelegate.onDestroy()
|
||||
|
||||
super.onDestroy()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user