Commit 5c7973d3 authored by Severin Rudie's avatar Severin Rudie Committed by Christian Sadilek
Browse files

Fixes #3254: fixes memory leak in ObserverRegistry

parent 84bbde3f
......@@ -84,8 +84,12 @@ class ObserverRegistry<T> : Observable<T> {
pausedObservers.remove(observer)
}
// Unregister observers
lifecycleObservers[observer]?.remove()
viewObservers[observer]?.remove()
// Remove observers from map
lifecycleObservers.remove(observer)
viewObservers.remove(observer)
}
override fun unregisterObservers() {
......@@ -95,6 +99,8 @@ class ObserverRegistry<T> : Observable<T> {
}
observers.clear()
pausedObservers.clear()
lifecycleObservers.clear()
viewObservers.clear()
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment