fixed memory leak

This commit is contained in:
Mariotaku Lee 2017-04-15 19:09:51 +08:00
parent 58cd65ca69
commit 48968d2985
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
1 changed files with 2 additions and 2 deletions

View File

@ -145,12 +145,12 @@ class UserColorNameManager(context: Context) {
}
fun unregisterColorChangedListener(listener: UserColorChangedListener) {
val preferenceChangeListener = colorChangedListeners[listener] ?: return
val preferenceChangeListener = colorChangedListeners.remove(listener) ?: return
colorPreferences.unregisterOnSharedPreferenceChangeListener(preferenceChangeListener)
}
fun unregisterNicknameChangedListener(listener: UserNicknameChangedListener) {
val preferenceChangeListener = nicknameChangedListeners[listener] ?: return
val preferenceChangeListener = nicknameChangedListeners.remove(listener) ?: return
nicknamePreferences.unregisterOnSharedPreferenceChangeListener(preferenceChangeListener)
}