Skip to content

Commit

Permalink
fix: memory leak when activity is destroyed (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabhsinghbisht authored Aug 30, 2024
1 parent 4af0c61 commit 1cd4d7b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ internal class AppLifecycleListener(private val screenUpdateCallback: OnCurrentS
override fun onActivityStarted(activity: Activity) {}
override fun onActivityStopped(activity: Activity) {}
override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}
override fun onActivityDestroyed(activity: Activity) {}
override fun onActivityDestroyed(activity: Activity) {
fragmentLifecycleCallbacks.activity = null
}
}

private fun Activity.registerFragmentLifecycle(callback: FragmentManager.FragmentLifecycleCallbacks) {
Expand Down

0 comments on commit 1cd4d7b

Please sign in to comment.